Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Enrich when using WithMetrics #2333

Open
zulander1 opened this issue Nov 18, 2024 · 1 comment
Open

Support for Enrich when using WithMetrics #2333

zulander1 opened this issue Nov 18, 2024 · 1 comment
Labels
comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore enhancement New feature or request

Comments

@zulander1
Copy link

Component

OpenTelemetry.Instrumentation.AspNetCore

Is your feature request related to a problem?

No response

What is the expected behavior?

When using AddAspNetCoreInstrumentation, there is no way to add Enrich using WithMetrics (as described here). It would be nice to have the possibility to update the activity so we can change the route according. My issue is that I am using version control and all the metrics are send out as "/api/v{version:apiVersion}" for the route name

 builder.Services.AddOpenTelemetry().WithMetrics(opts => opts

    .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("A"))
    .AddAspNetCoreInstrumentation()
    .AddRuntimeInstrumentation()
    .AddPrometheusExporter()
  );

Updating the activity would allow us to change the route name from GET /api/v{version:apiVersion}/ to GET /api/v1/
I am using NET 8 with minimal API

Which alternative solutions or features have you considered?

Update the route automatically as describe there here

Additional context

No response

@zulander1 zulander1 added the enhancement New feature or request label Nov 18, 2024
@github-actions github-actions bot added the comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore label Nov 18, 2024
@splitt3r
Copy link

splitt3r commented Nov 23, 2024

This would also be great to add route information for CoreWCF services. I think for .NET 8 + this needs to be done in the official ASP.NET Core repo

This is also partly related to #1730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants