Skip to content

google.golang.org/grpc/otelgrpc: Fix for elapsedTime records an incorrect metric value#8509

Merged
dmathieu merged 9 commits intoopen-telemetry:mainfrom
gaiaz-iusipov:fix-elapsed-time
Feb 10, 2026
Merged

google.golang.org/grpc/otelgrpc: Fix for elapsedTime records an incorrect metric value#8509
dmathieu merged 9 commits intoopen-telemetry:mainfrom
gaiaz-iusipov:fix-elapsed-time

Conversation

@gaiaz-iusipov
Copy link
Copy Markdown
Contributor

@gaiaz-iusipov gaiaz-iusipov commented Feb 5, 2026

Fix elapsedTime being recorded as (ms * 1000) in google.golang.org/grpc/otelgrpc. For example, a value of 5ms is written as 5s instead of 0.005s.

Fix #8518

@github-actions github-actions Bot requested a review from akats7 February 5, 2026 14:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.2%. Comparing base (dbf6452) to head (8ad286c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8509   +/-   ##
=====================================
  Coverage   82.2%   82.2%           
=====================================
  Files        179     179           
  Lines      13700   13700           
=====================================
  Hits       11265   11265           
  Misses      2033    2033           
  Partials     402     402           
Files with missing lines Coverage Δ
...n/google.golang.org/grpc/otelgrpc/stats_handler.go 98.4% <100.0%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmathieu
Copy link
Copy Markdown
Member

dmathieu commented Feb 5, 2026

Please keep your changes atomic (a single thing per PR).

@gaiaz-iusipov
Copy link
Copy Markdown
Contributor Author

I will remove from this PR the changes that are not related to the gRPC tooling.

@dmathieu
Copy link
Copy Markdown
Member

dmathieu commented Feb 5, 2026

For the record, this dates to #4548, before the stabilization of RPC attributes, and when the duration attribute was actually ms.
The semantic conventions upgrade missed the unit change.

Comment thread CHANGELOG.md Outdated
Co-authored-by: Damien Mathieu <42@dmathieu.com>
@dmathieu dmathieu merged commit 23524b0 into open-telemetry:main Feb 10, 2026
28 checks passed
@gaiaz-iusipov gaiaz-iusipov deleted the fix-elapsed-time branch February 10, 2026 09:30
@MrAlias MrAlias added this to the v1.41.0 milestone Feb 26, 2026
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.

otelgrpc: duration metrics record milliseconds but declare unit as seconds

4 participants