Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rahjesh-vunet authored Mar 10, 2024
2 parents dfca8f8 + 28d219b commit 2661e01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion content/en/docs/kubernetes/operator/automatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ EOF
```

By default, the Instrumentation resource that auto-instruments Java services
uses `otlp` with the `http+protobuf` protocol. This means that the configured
uses `otlp` with the `http/protobuf` protocol. This means that the configured
endpoint must be able to receive OTLP over `http` via `protobuf` payloads.
Therefore, the example uses `http://demo-collector:4318`, which connects to the
`http` port of the otlpreceiver of the Collector created in the previous step.
Expand Down
19 changes: 19 additions & 0 deletions content/en/docs/languages/java/instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,25 @@ OpenTelemetry provides a text-based approach to propagate context to remote
services using the [W3C Trace Context](https://www.w3.org/TR/trace-context/)
HTTP headers.

### Context propagation between threads

THe following example demonstrates how to propagate the context between threads:

```java
io.opentelemetry.context.Context context = io.opentelemetry.context.Context.current();
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try (Scope scope = context.makeCurrent()) {
// Code for which you want to propagate the context
}
}
});
thread.start();
```

### Context propagation between HTTP requests

The following presents an example of an outgoing HTTP request using
`HttpURLConnection`.

Expand Down

0 comments on commit 2661e01

Please sign in to comment.