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

docs: Fix tracing grpc example #2710

Merged
merged 5 commits into from
Feb 26, 2025

Conversation

cijothomas
Copy link
Member

This example was not building as required features were not enabled.
Also modified provider to use SimpleExporter, consistent with rest of examples to immediately see spans printed to console.
changed port from 50051 to 50052, as 50051 is what most tutorials showcase and hence likely to clash port.
Nit additions to span attributes. Eventually we need this to match the OTel conventions, but not this PR.

@cijothomas cijothomas requested a review from a team as a code owner February 26, 2025 07:03
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.3%. Comparing base (08a1f52) to head (45051ce).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2710   +/-   ##
=====================================
  Coverage   79.3%   79.3%           
=====================================
  Files        123     123           
  Lines      22670   22670           
=====================================
  Hits       17986   17986           
  Misses      4684    4684           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -58,16 +62,23 @@ async fn greet() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static

let response = client.say_hello(request).await;

let span = cx.span();
Copy link
Member Author

Choose a reason for hiding this comment

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

trying to get the span from context once, and re-use. Seeing the benchmarks for Context, I suspect asking for current span from Context repeatedly is unnecessarily burning CPU cycles.

@cijothomas cijothomas changed the title Fix tracing grpc example docs: Fix tracing grpc example Feb 26, 2025
@lalitb lalitb mentioned this pull request Feb 26, 2025
4 tasks
@cijothomas cijothomas merged commit 11ed8e0 into open-telemetry:main Feb 26, 2025
23 checks passed
@cijothomas cijothomas deleted the cijothomas/fix-grpc branch February 26, 2025 19:05
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.

3 participants