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

HTTP duration metrics should match HTTP span duration #69

Merged
merged 2 commits into from
Jun 2, 2023

Conversation

trask
Copy link
Member

@trask trask commented Jun 1, 2023

The purpose of this PR is to clarify one of the easier questions that came up as part of open-telemetry/opentelemetry-specification#3520.

I don't think I worded it great, if anyone has suggestions 🙇‍♂️

@trask trask requested review from a team June 1, 2023 01:31
@@ -56,6 +56,8 @@ operations. By adding HTTP attributes to metric events it allows for finely tune

This metric is required.

When this metric is reported alongside an HTTP server span, the metric value SHOULD be the same as the HTTP server span duration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I 100% agree with this statement, I think that the current shape of the API does not allow us to implement it. We can't retrieve start/end timestamps from a Span without converting it to SpanData first (because of the read/write API split), which is very wasteful. In the Java instrumentation we've decided to use current time at start/end of the operation (unless the start/end timestamps are explicitly provided by the instrumentation), and they are always a bit off compared to the span timestamps.

Also see open-telemetry/opentelemetry-java-instrumentation#5905 for a bit more context

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I 100% agree with this statement, I think that the current shape of the API does not allow us to implement it.

Correct, and that's exactly one of the reason why "SHOULD" is used rather than "MUST".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. It does seem a bit weird that we're adding a recommendation that can't be fulfilled at the moment, but I suppose that leaves us an option to fix that in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, good point, I guess it's more "aspirational" and hopefully will drive improvement in the SDK to make it a reality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants