-
Notifications
You must be signed in to change notification settings - Fork 774
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
Add support for some AspNetCoreMetricsInstrumentationOptions #3948
Add support for some AspNetCoreMetricsInstrumentationOptions #3948
Conversation
(cherry picked from commit 67b7c7a)
|
src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetricsInstrumentationOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetricsInstrumentationOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/MeterProviderBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Unshipped.txt
Show resolved
Hide resolved
@Temppus Please add a note in the project CHANGELOG about the change. |
@CodeBlanch Changelog updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We should probably update README with some details but that can be done as a follow-up. The current content is at least close 😄
@Temppus Just FYI I'm going to let this sit for a while to see if any other maintainers comment. Lots of people out on vacation.
I’m becoming suspicious of the Filter and maybe also Enrich callbacks… For traces I think Filter provides a poor approximation of a sampler. For example, say there's an endpoint that makes a call using HttpClient. If Filter is used to omit spans to this endpoint, often the user would expect the downstream HttpClient span to also be omitted. However, depending on the sampler in use, Filter cannot prevent the HttpClient span from being exported. Makes it seem like a custom sampler would be preferable. That said, Filter seems more appealing for metrics given metrics have no notion of a sampler. Though, I wonder if using I'm a little less suspicious of the value of Enrich, however, I suspect there are alternate solutions for many of the use cases for which Enrich is used.
There have been discussions in the spec to support this kind of scenario with either the View API and baggage (see #2619) or by introducing the concept of a measurement processor (much like a span processor but is invoked when a measurement is recorded). I'll put this PR on tomorrow's SIG meeting agenda for discussion (11 am Pacific). |
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Outdated
Show resolved
Hide resolved
Hi, what was the outcome of it ? |
09c7e85
to
cae48b8
Compare
Signed-off-by: Ivan Benovic <ivan.benovic@innovatrics.com>
Signed-off-by: Ivan Benovic <ivan.benovic@innovatrics.com>
Sync main
Apologies for delayed update. For now, I believe the consensus is that we are ok moving forward with Filter/Enrich functionality for metric instrumentation. Namely to maintain parity with traces. It is admittedly confusing to have it for one and not the other. Given no instrumentation has yet received a stable release, we will continue to evaluate the use cases Filter and Enrich serve. At a minimum, if Fitler/Enrich are kept when we release stable, we intend to better document their limitations over other solutions, so that end users can better understand if Filter/Enrich will meet their needs. |
Can you rerun the CI again ? Thanks. |
|
Hopefully last time ... |
Is TestRecoveryAfterFailedExport flaky ? It seems totally unrelated to my changes. |
Yes, the Code Coverage check is flaky. |
So there is a chance that when CI will be rerun it it will pass ? |
Don't bother about Code coverage action if there is not issue related to your code. It is not mandatory to pass before merge (as long as it is not stable). Other steps are passing. |
@CodeBlanch is there anything that should be changed to merge this ? |
src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/netcoreapp3.1/PublicAPI.Unshipped.txt
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3948 +/- ##
==========================================
- Coverage 85.30% 85.17% -0.13%
==========================================
Files 287 288 +1
Lines 11026 11059 +33
==========================================
+ Hits 9406 9420 +14
- Misses 1620 1639 +19
|
Changes
Hi. I wanted to include standard http metrics via
AddOpenTelemetryMetrics
and it works great. But I am missing option to add additional tags to current metrics recorded. In my case I wanted to enrich metrics with tag of current tenant.I saw there was no support for it yet.
Notes:
Tests:
I would like to here your feedback, thanks.
TODO:
CHANGELOG.md
updated for non-trivial changes