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

Simplify tracing-grpc example #1886

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/tracing-grpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ pub mod hello_world {
async fn greet() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
let tracer = global::tracer("example/client");
let span = tracer
.span_builder(String::from("Greeter/client"))
.span_builder("Greeter/client")
.with_kind(SpanKind::Client)
.with_attributes(vec![KeyValue::new("component", "grpc")])
.with_attributes([KeyValue::new("component", "grpc")])
.start(&tracer);
let cx = Context::current_with_span(span);
let mut client = GreeterClient::connect("http://[::1]:50051").await?;
Expand All @@ -76,7 +76,7 @@ async fn greet() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static
}
};
cx.span().add_event(
"Got response!".to_string(),
"Got response!",
vec![KeyValue::new("status", status)],
);

Expand Down
Loading