clj-otel 2024-11-20

Hello! We've been using clj-otel to add manual metrics instrumentation alongside the java agent to provide automatic instrumentation for libraries like jetty and clj-http/Apache HttpComponents. I'd like to leverage steffan-westcott.clj-otel.api.metrics.http.server/wrap-metrics-by-route to have per-route metrics (https://cljdoc.org/d/com.github.steffan-westcott/clj-otel-api/0.2.7/api/steffan-westcott.clj-otel.api.metrics.http.server#wrap-metrics-by-route) . The docstring notes > This interceptor should not be used for applications run with the OpenTelemetry instrumentation agent. What's the reason for this prohibition? If I suppress jetty auto instrumentation (https://opentelemetry.io/docs/zero-code/java/agent/disable/#suppressing-specific-agent-instrumentation) can I safely use wrap-metrics-by-route (and still keep automatic instrumentation for other libraries?

👍 1

good question

See answer below (I fat fingered the response on my mobile phone!)

🙂 No worries. Another acceptable answer is that Slack's UI sucks.

The automatic instrumentation performed by the agent produces traces and metrics for supported libraries. This overlaps some functionality of clj-otel such as wrap-metrics-by-route which could cause confusion if used together. Disabling metrics auto-instrumentation may be a way to alleviate that.

Cool. I'll give that a try. Thanks!