opsb
Open telemetry: how to include an array of primitive values in attributes
We’ve just started using OpenTelemetry — OpenTelemetry API v1.0.0-rc.3.2 to integrate our APM with Datadog. According to the Open Telemetry specification
- The attribute value, which is either:
- A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer.
- An array of primitive type values. The array MUST be homogeneous, i.e. it MUST NOT contain values of different types. For protocols that do not natively support array values such values SHOULD be represented as JSON strings. There’s also Span attributes: array of primitives · Issue #111 · open-telemetry/opentelemetry-erlang · GitHub which seems to imply that opentelemetry-erlang supports arrays of primitives in span attributes. However when I try to add span attributes with an array
OpenTelemetry.Span.start_span(span_ctx, [{"key1", ["one", "two"]}])
in the otel collector logs I see that attribute come through as EMPTY. Is it currently possible to use arrays or is there still some work to do?
@tristan I saw you mention that you were scanning for Open Telemetry questions so I hope you don’t mind me tagging you here.
First Post!
tristan
Hey, yea, @'ing me is fine :). Have you checked to make sure it isn’t being dropped on accident by the Erlang/Elixir code? Like by using the stdout trace exporter? If its there then it could be the protobuf conversion (we may even need to update the protobufs used in the exporter). I’ll have to look later, just wanted to throw some stuff out there in case you had time to investigate more before I do later today.







