fix: StopAgent panics when trace agent disabled (#3981)
Co-authored-by: ansoda <ansoda@gmail.com>
This commit is contained in:
@@ -59,7 +59,13 @@ func StartAgent(c Config) {
|
|||||||
|
|
||||||
// StopAgent shuts down the span processors in the order they were registered.
|
// StopAgent shuts down the span processors in the order they were registered.
|
||||||
func StopAgent() {
|
func StopAgent() {
|
||||||
_ = tp.Shutdown(context.Background())
|
lock.Lock()
|
||||||
|
defer lock.Unlock()
|
||||||
|
|
||||||
|
if tp != nil {
|
||||||
|
_ = tp.Shutdown(context.Background())
|
||||||
|
tp = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createExporter(c Config) (sdktrace.SpanExporter, error) {
|
func createExporter(c Config) (sdktrace.SpanExporter, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user