-
Notifications
You must be signed in to change notification settings - Fork 932
Description
What are you trying to achieve?
Updating the Python OTLP exporter to support None
values nested within the Logs SDK any
value open-telemetry/opentelemetry-python#4400. It is unclear how to convert null values into OTLP protobuf AnyValue
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:If exporters do not support exporting
null
values, they MAY replace those values by 0,false
, or empty strings. This is required for map/dictionary structures represented as two arrays with indices that are kept in syncI 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
vs null
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 as null
)".
Metadata
Metadata
Assignees
Labels
Type
Projects
Status