diff --git a/attribute/kv.go b/attribute/kv.go index 8f579338554..1ddf3ce0580 100644 --- a/attribute/kv.go +++ b/attribute/kv.go @@ -26,7 +26,7 @@ type KeyValue struct { // Valid returns if kv is a valid OpenTelemetry attribute. func (kv KeyValue) Valid() bool { - return kv.Key != "" && kv.Value.Type() != INVALID + return kv.Key.Defined() && kv.Value.Type() != INVALID } // Bool creates a KeyValue with a BOOL Value type.