Empty attribute values in disk buffering (#2268)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
This commit is contained in:
parent
28d8f21568
commit
c2c62aa973
|
|
@ -85,7 +85,13 @@ public final class AttributesMapper {
|
|||
} else if (value.array_value != null) {
|
||||
addArray(builder, key, value.array_value);
|
||||
} else {
|
||||
throw new UnsupportedOperationException();
|
||||
// Until we have complex attribute types that could potentially yield
|
||||
// empty objects, we MUST assume here that the writer put an empty string
|
||||
// into the value of the attribute. This will need to change later, when complex
|
||||
// types arrive and the spec issue is resolved.
|
||||
//
|
||||
// See spec issue: https://github.com/open-telemetry/opentelemetry-specification/issues/4660
|
||||
builder.put(AttributeKey.stringKey(key), "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class AttributesMapperTest {
|
|||
Attributes attributes =
|
||||
Attributes.builder()
|
||||
.put(AttributeKey.stringKey("someString"), "someValue")
|
||||
.put(AttributeKey.stringKey("emptyString"), "")
|
||||
.put(AttributeKey.booleanKey("someBool"), true)
|
||||
.put(AttributeKey.longKey("someLong"), 10L)
|
||||
.put(AttributeKey.doubleKey("someDouble"), 10.0)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ public final class TestData {
|
|||
.put("conditions", false, true)
|
||||
.put("scores", 0L, 1L)
|
||||
.put("coins", 0.01, 0.05, 0.1)
|
||||
.put("empty", "")
|
||||
.put("blank", " ")
|
||||
.build();
|
||||
|
||||
public static final Resource RESOURCE_FULL =
|
||||
|
|
|
|||
Loading…
Reference in New Issue