1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-03-05 15:05:51 +02:00

Error on span name set with uninitialized

This commit is contained in:
Tyler Yahn 2020-06-02 12:43:01 -07:00
parent 3e95c9c78e
commit 2efa30feec
No known key found for this signature in database
GPG Key ID: 42AA23B0BC85B798

View File

@ -23,6 +23,7 @@ import (
"google.golang.org/grpc/codes"
"go.opentelemetry.io/otel/api/global"
"go.opentelemetry.io/otel/api/kv"
apitrace "go.opentelemetry.io/otel/api/trace"
export "go.opentelemetry.io/otel/sdk/export/trace"
@ -205,7 +206,7 @@ func (s *span) SetName(name string) {
defer s.mu.Unlock()
if s.data == nil {
// TODO: now what?
global.Handle(fmt.Errorf("failed to set name on uninitialized span: %#v", s))
return
}
s.data.Name = name