fix: StopAgent panics when trace agent disabled (#3981)

Co-authored-by: ansoda <ansoda@gmail.com>
master^2
ansoda 8 months ago committed by GitHub
parent d184f96b13
commit 69bb746a1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -59,7 +59,13 @@ func StartAgent(c Config) {
// StopAgent shuts down the span processors in the order they were registered.
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) {

Loading…
Cancel
Save