Skip to content

Commit d86cb52

Browse files
authored
otel: Add info about custom attributes (#242)
Fixes svix/monorepo-private#11625 Co-authored-by: James Lucas <svix-james@users.noreply.github.com>
1 parent a0cfd74 commit d86cb52

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/opentelemetry-streaming.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,37 @@ Here is an example of how it looks like in an observability dashboard:
3737

3838
![OpenTelemetry Spans](./img/opentelemetry-spans.png)
3939

40+
41+
### Additional attributes
42+
You have the flexibility to add your own custom attributes to spans at either the app level or per event.
43+
44+
#### Application attributes
45+
You can add additional otel attributes per app by adding key-value pairs to an application's
46+
metadata, prefixing the key with `otel.`. Example:
47+
```json
48+
{
49+
"metadata": { "otel.custom-app-key-1": "custom-app-value-1" }
50+
}
51+
```
52+
53+
The param `custom-app-key-1=custom-app-value-1` will be added to your spans.
54+
55+
#### Event attributes
56+
You can add additional per-event attributes to your spans by passing custom key-value pairs in `transformationsParams.otel`
57+
when calling the Create Message endpoint. Example:
58+
```json
59+
{
60+
"payload": { "abc": "123" },
61+
"eventType": "my-event",
62+
"transformationsParams": {
63+
"otel": {
64+
"custom-key-1": "custom-value-1",
65+
"custom-key-2": "custom-value-2",
66+
}
67+
}
68+
}
69+
```
70+
4071
## How to use it
4172

4273
The raw spans sent by Svix can be used in a variety of ways:

0 commit comments

Comments
 (0)