1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

attribute: change INVALID Type to EMPTY and mark INVALID as deprecated (#8038)

Fixes https://github.com/open-telemetry/opentelemetry-go/issues/7932

Noticeable comment from previous PR:
https://github.com/open-telemetry/opentelemetry-go/pull/7942#discussion_r2913179215

Print the empty value as empty string per
https://opentelemetry.io/docs/specs/otel/common/#empty-values
This commit is contained in:
Robert Pająk
2026-03-12 09:43:04 +01:00
committed by GitHub
parent 205e24407e
commit f4da59e651
28 changed files with 136 additions and 119 deletions
+1 -1
View File
@@ -390,7 +390,7 @@ func (a KeyValue) String() string {
// ValueFromAttribute converts [attribute.Value] to [Value].
func ValueFromAttribute(value attribute.Value) Value {
switch value.Type() {
case attribute.INVALID:
case attribute.EMPTY:
return Value{}
case attribute.BOOL:
return BoolValue(value.AsBool())