You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: processors/opentelemetry_baggage_processor/README.md
+40-2Lines changed: 40 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,44 @@ Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_do
25
25
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
26
26
be found at [https://hexdocs.pm/opentelemetry_baggage_processor](https://hexdocs.pm/opentelemetry_baggage_processor).
27
27
28
-
## Configuration
28
+
## Usage
29
29
30
-
TODO: Add configuration instructions
30
+
<!-- MDOC -->
31
+
32
+
`OpentelemetryBaggageProcessor` provides a [Span Processor](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#span-processor)
33
+
that takes attributes from the [Baggage](https://hexdocs.pm/opentelemetry_api/otel_baggage.html)
34
+
and insert into the Span, once it starts.
35
+
36
+
A Span Processor is not an application, to use it you must update your
37
+
configuration:
38
+
39
+
```elixir
40
+
# config/config.exs
41
+
42
+
config :opentelemetry,
43
+
processors: [{:otel_baggage_processor, %{}}]
44
+
```
45
+
46
+
If you already have another processor defined, like `:otel_batch_processor`, add
47
+
the tuple and don't override the whole configuration.
48
+
49
+
Now every new span should have what's inside your baggage as attribute.
50
+
51
+
### Options
52
+
53
+
*`:prefix` - adds a prefix for all baggage attributes.
54
+
*`:filter` - only add attributes if the baggage metadata has the configured key.
55
+
The key must be a binary.
56
+
57
+
### Limitations
58
+
59
+
Baggage will follow the Context. So any limitation to Context Propagation applies
60
+
to Baggage Propagation, and thus to what attributes are going to be added to your
61
+
Span.
62
+
63
+
We can only apply attributes on Span's start, since that's when we can modify
64
+
them. There's a [BeforeEnd callback proposal](https://github.com/open-telemetry/opentelemetry-specification/issues/1089)
65
+
which would allow us to add the Baggage's attribute on Span's end too, but that
66
+
remains as something to be revisited in the future.
0 commit comments