Hi folks, I'm trying to get basic http.server.request.duration metrics in place in my Aleph-based application with Compojure routing. By adding the opentelemetry Java agent, I do see http.server.request.duration emitted, presumably by Netty (on which Aleph is built). However, it's missing the http.route attribute. I see from the discussion at https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/9813 that Netty does not implement this attribute and expects applications to do so at a higher level.
I do have this in my middleware stack and I was hoping this would be sufficient to add http.route:
(compojure/wrap-routes (comp trace-http/wrap-compojure-route trace-span/wrap-span))
trace-http/wrap-server-span
but no dice. Any idea on what else I might need to do?
It is probably worth noting that my OpenTelemetry target does not support traces, only metrics. Is that my issue?The level of support for the http.route attribute on metrics maintained by the OpenTelemetry instrumentation agent varies for each library. In the case of Netty (and hence Aleph), it appears this isn't currently supported. As far as I'm aware, the OpenTelemetry Java API does not offer a way to modify metric values, for example, attaching an attribute.
OK, thank you. I'm assuming that means that my only option here is to not use the instrumentation agent at all and instead recreate the http.server.request.duration metric myself in middleware--is that consistent with your understanding?
Yes. Be sure to disable Netty library support in the agent, or omit the agent enirely, to prevent conflicts with the middleware provided by clj-otel