-
Notifications
You must be signed in to change notification settings - Fork 502
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
docs: Fix tracing grpc example #2710
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
@@ -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(); |
There was a problem hiding this comment.
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.
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.