Skip to content

Commit a840b47

Browse files
committed
add readme
1 parent e978732 commit a840b47

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

baggage-processor/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,37 @@ processors through configuration.
2525
| `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. |
2626
| `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. |
2727

28+
### Usage with declarative configuration
29+
30+
You can configure the baggage span and log record processors using declarative YAML configuration with the OpenTelemetry SDK.
31+
32+
For the tracer provider (span processor):
33+
34+
```yaml
35+
file_format: 1.0-rc.1
36+
tracer_provider:
37+
processors:
38+
- baggage:
39+
included: [foo]
40+
excluded: [bar]
41+
```
42+
43+
For the logger provider (log record processor):
44+
45+
```yaml
46+
file_format: 1.0-rc.1
47+
logger_provider:
48+
processors:
49+
- baggage:
50+
included: [foo]
51+
excluded: [bar]
52+
```
53+
54+
This will configure the respective processor to include baggage keys listed in `included` and
55+
exclude those in `excluded` as explained in
56+
[Properties which pattern matching
57+
](https://github.com/open-telemetry/opentelemetry-configuration/blob/main/CONTRIBUTING.md#properties-which-pattern-matching).
58+
2859
### Usage through programmatic activation
2960

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

baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageLogRecordComponentProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BaggageLogRecordComponentProviderTest {
1818
@Test
1919
void declarativeConfig() {
2020
String yaml =
21-
"file_format: 0.4\n"
21+
"file_format: 1.0-rc.1\n"
2222
+ "logger_provider:\n"
2323
+ " processors:\n"
2424
+ " - baggage:\n"

baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanComponentProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BaggageSpanComponentProviderTest {
1818
@Test
1919
void declarativeConfig() {
2020
String yaml =
21-
"file_format: 0.4\n"
21+
"file_format: 1.0-rc.1\n"
2222
+ "tracer_provider:\n"
2323
+ " processors:\n"
2424
+ " - baggage:\n"

0 commit comments

Comments
 (0)