clj-otel

grzm 2024-11-20T12:24:50.886599Z

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
lepistane 2024-11-20T17:04:43.028259Z

good question

steffan 2024-11-20T19:46:50.266319Z

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

grzm 2024-11-20T19:51:31.462339Z

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

steffan 2024-11-20T19:45:03.644569Z

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.

grzm 2024-11-20T19:50:47.785759Z

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