-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up readme as we already removed tracing-opentelemetry and jaeger from it.
- Loading branch information
1 parent
85f678a
commit 433c1b3
Showing
5 changed files
with
36 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
# GRPC example | ||
|
||
Example showing [Tonic] client and server interaction with OpenTelemetry context propagation. [tracing_opentelemetry](https://docs.rs/tracing-opentelemetry/0.4.0/tracing_opentelemetry/) is used to hook into the [tracing](https://github.com/tokio-rs/tracing) ecosystem, which enables drop-in replacements for [log](https://github.com/rust-lang/log) macros and an `#[instrument]` macro that will automatically add spans to your functions. | ||
Example showing [Tonic] client and server interaction with OpenTelemetry context | ||
propagation. Traces are exported to stdout. | ||
|
||
[Tonic]: https://github.com/hyperium/tonic | ||
|
||
Examples | ||
-------- | ||
## Running the example | ||
|
||
```shell | ||
# Run jaeger in background | ||
$ docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest | ||
|
||
# Run the server | ||
# Run the server first | ||
$ cargo run --bin grpc-server | ||
|
||
# Now run the client to make a request to the server | ||
$ cargo run --bin grpc-client | ||
|
||
# View spans (see the image below) | ||
$ firefox http://localhost:16686/ | ||
``` | ||
|
||
![Jaeger UI](trace.png) | ||
Observe that the traces are exported to stdout, and that they share the same | ||
TraceId. Also, the server span would be parented to the client span. The example | ||
demonstrates how to propagate and restore OpenTelemetry context when making | ||
out-of-process calls, so as to ensure the same trace is continued in the next | ||
process. The client here initiates the trace by creating the root client span, | ||
and it propagates its context to the server. The server, extracts the context, | ||
and creates its own server span using the extracted context, ensuring both spans | ||
are correlated. |
This file contains 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
This file contains 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