Open flokli opened 1 day ago
The field to distinguish is probably http.route
, as per https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/
Though they explicitly mention this can be just the routes the framework is configured with, meaning we could have out-of-the-box handling for axum::Router.
Looking at the docs, we currently use a single
.layer()
call on a axum Router.That way we however are not able to distinguish individual types of requests.
I'd ideally like to have the counters/histograms provided by this crate on a per-endpoint-of-specific-type granularity.
What do you think about adding an example applying the handler to two separate individual handlers?
We maybe would end up with separate
HTTPMetricsLayer
instances, and add a method toHTTPMetricsLayerBuilder
allowing to add additional (static for the lifetime ofHTTPMetricsLayer
) fields?