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

AspNet Metrics Instrumentation Enrich & Filter #1226

Closed
1 of 2 tasks
ZRich97 opened this issue Jun 8, 2023 · 6 comments · Fixed by #1407
Closed
1 of 2 tasks

AspNet Metrics Instrumentation Enrich & Filter #1226

ZRich97 opened this issue Jun 8, 2023 · 6 comments · Fixed by #1407
Labels
comp:instrumentation.aspnet Things related to OpenTelemetry.Instrumentation.AspNet

Comments

@ZRich97
Copy link
Contributor

ZRich97 commented Jun 8, 2023

Issue with OpenTelemetry.Instrumentation.AspNet

Using Open Telemetry's AspNetCore instrumentation, we can automatically generate, enrich, and filter a default http.server.duration metric using AspNetCoreMetricsInstrumentationOptions in our .NET Core services.

Through the similar AspNet instrumentation used in .NET Framework services it is possible to emit the http.server.duration metric, but the same filtering and enrichment options are not available. Does any mechanism currently exist to attach additional dimensions or apply filtering logic to the auto-instrumented metric in .NET Framework?

For example, we're able to use the below logic in .NET Core and are aiming to do the same in .NET Framework.
image

Is this a feature request or a bug?

  • Feature Request
  • Bug

What is the expected behavior?

Parity between .NET Core and .NET Framework metric configuration options.

What is the actual behavior?

Currently, .NET Framework services do not have the same ability to enrich and filter the default metrics generated by Open Telemetry instrumentation libraries. .NET Framework services would be limited to the default dimensions and have no ability to filter based on custom logic.

Additional Context

Pointed here by @cijothomas after initially posting in the opentelemetry-dotnet Discussions board here.

@ZRich97 ZRich97 added the comp:instrumentation.aspnet Things related to OpenTelemetry.Instrumentation.AspNet label Jun 8, 2023
@Kielek
Copy link
Contributor

Kielek commented Jun 9, 2023

@ZRich97, any chance that you will contribute to create this features?

@ZRich97
Copy link
Contributor Author

ZRich97 commented Jun 9, 2023

@ZRich97, any chance that you will contribute to create this features?

Originally, I was reaching out to see whether this functionality already existed for .NET Framework or was already in progress/planned. If it isn't, I may be able to look into implementing it.

@ZRich97
Copy link
Contributor Author

ZRich97 commented Nov 4, 2023

@Kielek I've started work on a draft PR to enable this functionality (#1426). As this would be my first contribution to this project, let me know if you have any feedback before I publish the PR.

Also, I noticed that the AspNetCore Instrumentation project removed this functionality in a recent PR due to upcoming .NET 8 features (open-telemetry/opentelemetry-dotnet#4981). Do the enrich and filter features still make sense for the AspNet Instrumentation package, or would they be blocked from merging?

@ZRich97
Copy link
Contributor Author

ZRich97 commented Dec 19, 2023

@Kielek - the changes resolving this issue have been merged but are unreleased. Our team is interested in using the Enrich() feature when it is made available.

Is there a planned next release for the AspNet package, or should I create a PR requesting one (similar to this one)?

@Kielek
Copy link
Contributor

Kielek commented Dec 19, 2023

Please create the PR

@ZRich97
Copy link
Contributor Author

ZRich97 commented Dec 19, 2023

Please create the PR

Created PR here: #1505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.aspnet Things related to OpenTelemetry.Instrumentation.AspNet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants