clj-otel

devurandom 2024-04-05T18:50:20.296139Z

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

steffan 2024-04-05T22:16:41.580229Z

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

devurandom 2024-04-08T09:54:10.584199Z

Thanks, @steffan! 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?

steffan 2024-04-08T14:18:41.143509Z

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.

devurandom 2024-04-08T14:19:33.494539Z

Thanks for this additional context!

2024-04-05T04:05:22.002789Z

Does it matter if use 1.x or 2.x javaagent? what do you suggest. https://mvnrepository.com/artifact/io.opentelemetry.javaagent/opentelemetry-javaagent

steffan 2024-04-05T22:31:24.277889Z

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