Skip to content

Commit

Permalink
Update README.md to put the emphasis on SDK Auto Configuration (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrille-leclerc authored Jan 6, 2025
1 parent ec755da commit 6069c1d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions baggage-processor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ Do not put sensitive information in Baggage.

## Usage

### Usage with SDK auto-configuration

If you are using the OpenTelemetry SDK auto-configuration, you can add the span and log baggage
processors through configuration.

| Property | Description |
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| `otel.java.experimental.span-attributes.copy-from-baggage.include` | Add baggage entries as span attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |
| `otel.java.experimental.log-attributes.copy-from-baggage.include` | Add baggage entries as log attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |

### Usage through programmatic activation

Add the span and log processor when configuring the tracer and logger providers.

To configure the span and log processors to copy all baggage entries during configuration:
Expand Down Expand Up @@ -49,16 +61,6 @@ new BaggageSpanProcessor(baggageKey -> pattern.matcher(baggageKey).matches());
new BaggageLogRecordProcessor(baggageKey -> pattern.matcher(baggageKey).matches());
```

## Usage with SDK auto-configuration

If you are using the OpenTelemetry SDK auto-configuration, you can add the span and log baggage
processors through configuration.

| Property | Description |
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| `otel.java.experimental.span-attributes.copy-from-baggage.include` | Add baggage entries as span attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |
| `otel.java.experimental.log-attributes.copy-from-baggage.include` | Add baggage entries as log attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |

## Component owners

- [Mike Golsmith](https://github.com/MikeGoldsmith), Honeycomb
Expand Down

0 comments on commit 6069c1d

Please sign in to comment.