google.golang.org/grpc/otelgrpc: Fix for elapsedTime records an incorrect metric value by gaiaz-iusipov · Pull Request #8509 · open-telemetry/opentelemetry-go-contrib (original) (raw)

Conversation

@gaiaz-iusipov

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

@gaiaz-iusipov

@gaiaz-iusipov

@gaiaz-iusipov

@codecov

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:

@dmathieu

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

@gaiaz-iusipov

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

@dmathieu

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.

dmathieu

@gaiaz-iusipov @dmathieu

Co-authored-by: Damien Mathieu 42@dmathieu.com

dmathieu

@dmathieu dmathieu linked an issue

Feb 6, 2026

that may beclosed by this pull request

dashpole

MrAlias

@MrAlias

@dmathieu

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})