Skip to content

Commit 3b654d3

Browse files
committed
default to empty string for unknown value types.
1 parent 59013f6 commit 3b654d3

File tree

1 file changed

+7
-2
lines changed
  • disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/common

1 file changed

+7
-2
lines changed

disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/common/AttributesMapper.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,13 @@ private static void addValue(AttributesBuilder builder, String key, AnyValue val
8484
builder.put(AttributeKey.doubleKey(key), value.double_value);
8585
} else if (value.array_value != null) {
8686
addArray(builder, key, value.array_value);
87-
} else {
88-
throw new UnsupportedOperationException();
87+
}
88+
else {
89+
// Until we have complex attribute types that could potentially yield
90+
// empty objects, we MUST assume here that the writer put an empty string
91+
// into the value of the attribute. This will need to change later, when complex
92+
// types arrive and the spec issue is resolved.
93+
builder.put(AttributeKey.stringKey(key), "");
8994
}
9095
}
9196

0 commit comments

Comments
 (0)