Fork me on GitHub
#clj-otel
<
2024-04-05
>
steffan22:04:24

OpenTelemetry instrumentation agent 2.x has several https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v2.0.0, notably around some default OTLP protocols and semantic conventions. I suggest using migrating to 2.x as soon as is convenient. The clj-otel documentation and examples have been updated such that they assume agent 2.x is used.

🙌 1
devurandom18:04:20

Hi! Is there a technical reason that steffan-westcott.clj-otel.api.trace.http/wrap-server-span does not do the captured-request-headers part of (wrap-server-request-attrs create-span-opts) when :create-span? false? See-also: https://github.com/steffan-westcott/clj-otel/issues/17

steffan22:04:41

clj-otel has no influence on the agent. Please see the longer answer https://github.com/steffan-westcott/clj-otel/issues/17#issuecomment-2040695513.

devurandom09:04:10

Thanks, @U2C6SPLDS! Just for my own understanding of OTel semantics: clj-otel cannot add attributes to an existing span? They can only be set at the time the span is created?

steffan14:04:41

The clj-otel function add-span-data! can be used to add attributes to an existing span. However, it is not advisable to add HTTP header attributes to a span created by the agent. The values of some HTTP headers may be security sensitive. When using the agent, one would expect the definitive list of headers to add to server spans to be specified in the agent configuration. It would be surprising if other headers not in that list were also added. In general, clj-otel can configured to add basic telemetry data for applications that are run without the agent, such as HTTP server spans and metrics. However, clj-otel is documented and designed not to add this data for applications that are run with the agent. The agent will always provide data of superior quality than data from clj-otel, because the agent is tightly integrated with the supported libraries.

devurandom14:04:33

Thanks for this additional context!