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

shippingservice: add http client request span #610

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#587](https://github.com/open-telemetry/opentelemetry-demo/pull/587))
* Pass product's `categories` as an input for the Ad service
([#600](https://github.com/open-telemetry/opentelemetry-demo/pull/600))
* Add HTTP client instrumentation to shippingservice
([#610](https://github.com/open-telemetry/opentelemetry-demo/pull/610))
17 changes: 16 additions & 1 deletion docs/services/shippingservice.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Be mindful of async runtime, [context
guards](https://docs.rs/opentelemetry/latest/opentelemetry/struct.ContextGuard.html),
and inability to move and clone `spans` when replicating from these samples.

### Adding gRPC/HTTP instrumentation
### Adding gRPC instrumentation

This service receives gRPC requests, which are instrumented in the middleware.

Expand Down Expand Up @@ -107,6 +107,21 @@ You may also notice the `attributes` set on the span in this example, and
context) the [OpenTelemetry API](https://docs.rs/opentelemetry/0.17.0/opentelemetry/trace/struct.SpanRef.html)
will work.

### Adding HTTP instrumentation

A child *client* span is also produced for the outoing HTTP call to
`quoteservice` via the `reqwest` client. This span pairs up with the
corresponding `quoteservice` *server* span. The tracing instrumentation is
implemented in the client middleware making use of the available
`reqwest-middleware`, `reqwest-tracing` and `tracing-opentelementry` libraries:

```rust
let reqwest_client = reqwest::Client::new();
let client = ClientBuilder::new(reqwest_client)
.with(TracingMiddleware::<SpanBackendWithUrl>::new())
.build();
```

### Add span attributes

Provided you are on the same thread, or in a context passed from a
Expand Down
Loading