Unable to add metric attributes using otelhttp.WithMetricAttributesFn
for http server
#6540
Labels
area: instrumentation
Related to an instrumentation package
bug
Something isn't working
instrumentation: otelhttp
Description
Unable to add metric attributes using
otelhttp.WithMetricAttributesFn
for http server. The attributes defined in the function are not included in the produced metrics.Environment
otelhttp
: v0.58.0Steps To Reproduce
Actual Behavior:
The produced metrics do not include the attributes defined in
WithMetricAttributesFn
Expected behavior
expected the produced metrics to include the attribute added in the
WithMetricAttributesFn
method.eg.
Additonal Context
I came across #5876 , which added support for custom attributes but it seems to only handle outbound HTTP requests through
Transport
struct. It looks like this behavior has not been extended to server-side metrics viasemconv.HTTPServer
.Proposal and Contribution Inquiry:
Would it make sense to extend this support for HTTP server metrics, possibly in
semconv.HTTPServer
or a related component?I’d be happy to contribute a PR if the maintainers are open to this improvement. Please let me know if this is something worth pursuing!
The text was updated successfully, but these errors were encountered: