diff --git a/baggage-processor/README.md b/baggage-processor/README.md index 4dc306114..cb8c8a356 100644 --- a/baggage-processor/README.md +++ b/baggage-processor/README.md @@ -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: @@ -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