Is your feature request related to a problem? Please describe the problem.
I have a multi-tenant system where I am starting to record metrics. There are some important tags that I need to add to the framework provided http.server.request.duration such as user, tenant. I can do this via the IHttpMetricsTagsFeature which provides a Tags collection.
What I can't do it prevent the addition of, or remove after their addition, of framework provided tags like url.scheme or network.protocol.version which have no value to me. These tags seem to be added very late in the lifecycle of the request so when I have access to the IHttpMetricsTagsFeature.Tags through middleware the framework added tags are not present.
In the opentelemetry aspnet (not core) instrumentation there is a callback available which is called once tags have been added and the metric is about to be dispatched. This pattern is ideal. The opentelemetry aspnetcore instrumentation does not have this callback because the metric is now raised by the framework.
Describe the solution you'd like
I would like to have a callback method that I can use to edit the tags on the framework-provided http.server.request.duration event allowing me to remove unwanted tags.
Additional context
The tags can be removed if you are using the otelcol-contrib collector to route data from your app to the destination. This costs resources that could be better spent. It would be better not to generate unwanted information to start with.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I have a multi-tenant system where I am starting to record metrics. There are some important tags that I need to add to the framework provided
http.server.request.duration
such as user, tenant. I can do this via theIHttpMetricsTagsFeature
which provides a Tags collection.What I can't do it prevent the addition of, or remove after their addition, of framework provided tags like
url.scheme
ornetwork.protocol.version
which have no value to me. These tags seem to be added very late in the lifecycle of the request so when I have access to theIHttpMetricsTagsFeature.Tags
through middleware the framework added tags are not present.In the opentelemetry aspnet (not core) instrumentation there is a callback available which is called once tags have been added and the metric is about to be dispatched. This pattern is ideal. The opentelemetry aspnetcore instrumentation does not have this callback because the metric is now raised by the framework.
Describe the solution you'd like
I would like to have a callback method that I can use to edit the tags on the framework-provided
http.server.request.duration
event allowing me to remove unwanted tags.Additional context
The tags can be removed if you are using the otelcol-contrib collector to route data from your app to the destination. This costs resources that could be better spent. It would be better not to generate unwanted information to start with.