-
Notifications
You must be signed in to change notification settings - Fork 773
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
HttpSemanticConventions - new metric in AspNetCore Instrumentation. #4802
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4802 +/- ##
=======================================
Coverage 83.90% 83.90%
=======================================
Files 293 293
Lines 12001 12028 +27
=======================================
+ Hits 10069 10092 +23
- Misses 1932 1936 +4
|
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Outdated
Show resolved
Hide resolved
| Name | Instrument Type | Unit | Description | | ||
|-------|-----------------|------|-------------| | ||
| `http.server.duration` | Histogram | `ms` | Measures the duration of inbound HTTP requests. | | ||
Have you opt-ed into the new Http Semantic Conventions using `OTEL_SEMCONV_STABILITY_OPT_IN`? |
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.
Have you opt-ed into the new Http Semantic Conventions using `OTEL_SEMCONV_STABILITY_OPT_IN`? | |
Have you opted in to the new Http Semantic Conventions using `OTEL_SEMCONV_STABILITY_OPT_IN`? |
| `http.server.request.duration` | Histogram | `s` | Measures the duration of inbound HTTP requests. | | ||
|
||
This metric is emitted in `seconds` as per the semantic convention. While | ||
the convention [recommends using custom histogram buckets](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-metrics.md#metric-httpserverrequestduration) |
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.
Use the commit tag?
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.
I'm conflicted here.
I would rather link to an explicit tag. There changes we're implementing now are post v1.21.0, but this repo hasn't made a new release yet.
I can change links in both the Readme and Changelog to a commit as you've suggested.
When the next release happens (presumably v1.22.0) I think we should update these links.
into the new semantic convention by configuring the `OTEL_SEMCONV_STABILITY_OPT_IN` | ||
environment variable. This metric measures time in seconds and offers unique | ||
histogram buckets as per the | ||
[spec](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-metrics.md#metric-httpserverrequestduration) |
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.
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.
Left a few suggestions for CHANGELOG and README.
* Introduced a new metric, `http.server.request.duration`, for users who opt | ||
into the new semantic convention by configuring the `OTEL_SEMCONV_STABILITY_OPT_IN` | ||
environment variable. This metric measures time in seconds and offers unique | ||
histogram buckets as per the |
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.
This metric measures time in seconds and offers unique
histogram buckets
Not sure how to interpret "offers unique histogram buckets"? What does it mean?
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.
"offers" is the wrong word here, "uses" would be more appropriate.
I'm trying to call attention to the fact that the buckets are different than the default.
4 lines below this I list the exact buckets.
I'm trying to find a succinct way to describe that this metric is different than what came before.
@cijothomas, do you think this would be better as a bulleted list?
ie:
- new metric: `http.server.request.duration`
- unit: seconds
- buckets: 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1,
2.5, 5, 7.5, 10
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.
the list is good. Hint that the buckets are so, because SDK specially handles this metric.
| `http.server.duration` | Histogram | `ms` | Measures the duration of inbound HTTP requests. | | ||
Have you opt-ed into the new Http Semantic Conventions using `OTEL_SEMCONV_STABILITY_OPT_IN`? | ||
|
||
* If yes, the instrumentation supports the following metric. |
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.
this is not clear. The env variable can take none,http,http/dup as values, This doc should also be structured in that way. i.e what if the env variable is set to "none", (also the default)
what is the env varaible is set to "http"
what is the env varaible is set to "http/dup" - both metric are emitted
@utpilla, @cijothomas, @vishweshbankwar |
@@ -2,6 +2,26 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Introduced a new metric, `http.server.request.duration`, for users who opt-in |
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.
Introduced a new metric, http.server.request.duration
, for users who opt-in
to the new semantic convention by configuring the OTEL_SEMCONV_STABILITY_OPT_IN
environment variable to value "fillthis". This metric measures time in seconds, but histogram buckets are adjusted
automatically for this metric by OTel SDK which specially treat this metric. This metric follows the OTel Semantic Conventions from (add link).
- Metric Name:
http.server.request.duration
- Unit:
seconds
- Histogram Buckets:
0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10
(due to OpenTelemetry SDK's special treatment) - Replaces old metric:
http.server.duration
- Unit:
miliseconds
- Histogram Buckets:
0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000
(the general default of Histogram buckets)
- Unit:
OTEL_SEMCONV_STABILITY_OPT_IN
may be set to "fillthis", to help an easier transition, at the cost of emitting both old and new metrics.
^did some refactoring. Feel free to take it with modifications.
A user who do not have any experience with OTel sem. conventions and the new vs old, should find it easy to follow the changelog. Key things I'd prefer to convey here are:
- No breaking changes if you just update to this new version.
- Opt-in feature to emit a new metric that follows a new convention, which despite using "s", still allows good histogram precision due to SDK treating it specially.
- Hint at emitting both to smooth transition.
- Hint that the new metric is the long term bet, as it'll be the one getting stabilizied by Otel sem convention.
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.
Thanks for the refactor. I'll take another pass at this today.
Do we typically put instructions in the changelog? I was trying to keep the changelog succinct, and use the readme for the full information. The challenge is that this change has a LOT of details :)
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.
just pushed my rewrite. I think I've addressed all your points. please re-review.
@TimothyMothra Thanks for your patience on working on this PR! |
This one was tricky and touched a lot of parts! Glad we could get this merged. |
Towards #4484
Supersedes #4766
This PR focus on introducing the new
http.server.request.duration
metrics in the AspNetCore Instrumentation library.Changes
OTEL_SEMCONV_STABILITY_OPT_IN
http.server.duration
(milliseconds) replaced withhttp.server.request.duration
(secondsmillisecondsseconds)This is defined in the as-of-yet unreleased v1.22.0 https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-metrics.md
server.port
server.address
Future work
The unit of this metric needs to be changed to seconds. This requires a different default histogram.DONE!Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes