-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Mismatch of units between calculated span duration and metric name #27488
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I agree this is a valid issue. From documentation, timestamps are epoch time in nano seconds, so we need to divide by The math has been this way since the original introduction of the processor, so users likely expect the values to be in milliseconds even though it doesn't line up with the unit name. Due to this incorrect expectation, we need to clearly communicated to users that this change occurred so they're not caught off guard. I'd think fixing the unit is a better solution than changing metric names to match implementation. In my mind milliseconds makes a bit more sense as the latency metric, but it would be a breaking change to update them. I'll defer to code owners regarding the best path forward. |
…onds instead of milliseconds (#27665) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Measures latency in seconds instead of milliseconds, as the metric name indicates. Previously, milliseconds was used. This unit is still available via the feature gate `processor.servicegraph.legacyLatencyUnitMs`. This is a breaking change. **Link to tracking Issue:** <Issue number if applicable> #27488 **Testing:** <Describe what testing was performed and which tests were added.> Tests are updated **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Curtis Robert <92119472+crobert-1@users.noreply.github.com> Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Fixed by #27665 |
…onds instead of milliseconds (open-telemetry#27665) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Measures latency in seconds instead of milliseconds, as the metric name indicates. Previously, milliseconds was used. This unit is still available via the feature gate `processor.servicegraph.legacyLatencyUnitMs`. This is a breaking change. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#27488 **Testing:** <Describe what testing was performed and which tests were added.> Tests are updated **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Curtis Robert <92119472+crobert-1@users.noreply.github.com> Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
…onds instead of milliseconds (open-telemetry#27665) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Measures latency in seconds instead of milliseconds, as the metric name indicates. Previously, milliseconds was used. This unit is still available via the feature gate `processor.servicegraph.legacyLatencyUnitMs`. This is a breaking change. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#27488 **Testing:** <Describe what testing was performed and which tests were added.> Tests are updated **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Curtis Robert <92119472+crobert-1@users.noreply.github.com> Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Component(s)
connector/servicegraph, processor/servicegraph
What happened?
Description
The service graph connector calculates and buckets the duration of spans in milliseconds but stores it in a metric with the suffix
_seconds
.Steps to Reproduce
Enable the service graph connector.
Expected Result
The buckets and calculated span durations should match the unit in the metric name.
Potential Solution
The following span duration calculations are modified to return the duration in seconds:
float64(span.EndTimestamp()-span.StartTimestamp()) / float64(time.Millisecond.Nanoseconds())
e.g.
float64(span.EndTimestamp()-span.StartTimestamp()) / float64(time.Second.Nanoseconds())
Additionally, the following default buckets to be updated to seconds:
e.g.
Collector version
v0.85.0
Environment information
No response
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: