Logs data model canonical OTLP encoding for null any values #4392
Labels
maintainer-request
Escalated by SIG maintainers
sig-issue
A specific SIG should look into this before discussing at the spec
spec:logs
Related to the specification/logs directory
What are you trying to achieve?
Updating the Python OTLP exporter to support
None
values nested within the Logs SDKany
value open-telemetry/opentelemetry-python#4400. It is unclear how to convert null values into OTLP protobufAnyValue
messages. I may have missed it in the spec already but there are some unclear cases:KeyValue with null value:
{"foo": None}
. ShouldKeyValue.value
be left unset or get an emptyAnyValue
?ArrayValue containing null:
{"foo": [1, 2, None]}
. The common spec is pretty clear that exporters should preserve the ordering:I think the empty
AnyValue
would be appropriate here.Body is null. Should
LogRecord.body
be left unset or be set to an explicit emptyAnyValue
?For languages with
undefined
vsnull
distinction, this all gets more complicated so we should consider OTel JS too.Additional context.
Note that 2 affects tracing and metrics as well since "
null
values within arrays MUST be preserved as-is (i.e., passed on to span processors / exporters asnull
)".The text was updated successfully, but these errors were encountered: