Skip to content

examples/opentelemetry: enabling experimental metrics #8441

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vinothkumarr227
Copy link
Contributor

Fixes #8311

RELEASE NOTES:

Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.36%. Comparing base (8adcc94) to head (9c4b954).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8441      +/-   ##
==========================================
+ Coverage   82.31%   82.36%   +0.04%     
==========================================
  Files         414      413       -1     
  Lines       40464    40513      +49     
==========================================
+ Hits        33308    33368      +60     
+ Misses       5791     5774      -17     
- Partials     1365     1371       +6     

see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eshitachandwani
Copy link
Member

Please link the comment in response to which this PR has been raised. @vinothkumarr227

@vinothkumarr227
Copy link
Contributor Author

@arjan-bal This fix was made following the review comment from in this discussion

@@ -70,8 +70,8 @@ func main() {
// up-to-date list of metrics, see:
// https://grpc.io/docs/guides/opentelemetry-metrics/#instruments
Metrics: opentelemetry.DefaultMetrics().Add(
"grpc.client.attempt.started",
"grpc.client.attempt.duration",
"grpc.xds_client.resource_updates_valid",
Copy link
Member

Choose a reason for hiding this comment

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

Correct me if I am wrong but I dont think we are using xds in this example , so using xds metrics might not make sense. Can you change to use some other metrics? Example : grpc.lb.pick_first. connection_attempts_succeeded

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eshitachandwani , Thanks for the review! I don’t think we need to change this example — we’ve already mentioned that it’s meant to demonstrate experimental metrics. Also, this is aligned with the discussion here: grpc-go#8234 (comment).

Copy link
Member

Choose a reason for hiding this comment

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

But the example in my opinion should be a working example , like if someone is trying to run the example , they should be able to see some metrics. And since the example is not using xds , there will be no metrics for the xds client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I’ve updated the example to use pick_first with a valid address, and it now emits metrics

@vinothkumarr227 vinothkumarr227 removed their assignment Jul 24, 2025
@eshitachandwani eshitachandwani self-assigned this Jul 25, 2025
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.

stats: Update documentation and examples to demonstrate enabling experimental metrics
4 participants