Skip to content

Commit 481ca7c

Browse files
committed
Evolve observability documentation
1 parent 49ca10e commit 481ca7c

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ informal introduction to the features and their implementation.
9797
- [Worker Shutdown](#worker-shutdown)
9898
- [Testing](#testing-1)
9999
- [Workflow Replay](#workflow-replay)
100-
- [OpenTelemetry Support](#opentelemetry-support)
100+
- [Observability](#observability)
101101
- [Protobuf 3.x vs 4.x](#protobuf-3x-vs-4x)
102102
- [Known Compatibility Issues](#known-compatibility-issues)
103103
- [gevent Patching](#gevent-patching)
@@ -1344,10 +1344,31 @@ async def check_past_histories(my_client: Client):
13441344
)
13451345
```
13461346

1347-
### OpenTelemetry Support
1347+
### Observability
13481348

1349-
OpenTelemetry support requires the optional `opentelemetry` dependencies which are part of the `opentelemetry` extra.
1350-
When using `pip`, running
1349+
See https://github.com/temporalio/samples-python/tree/main/open_telemetry for a sample demonstrating collection of
1350+
metrics and tracing data emitted by the SDK.
1351+
1352+
#### Metrics
1353+
1354+
The SDK emits various metrics by default: see https://docs.temporal.io/references/sdk-metrics. By default, these are
1355+
emitted with attributes `namespace`, `task_queue`, `workflow_type` / `activity_type`, and
1356+
`service_name=temporal-core-sdk`. To emit additional attributes with all metrics, pass
1357+
[global_tags](https://python.temporal.io/temporalio.runtime.TelemetryConfig.html#global_tags) when creating the
1358+
[TelemetryConfig](https://python.temporal.io/temporalio.runtime.TelemetryConfig.html).
1359+
1360+
For emitting custom metrics, the SDK makes a metric meter available:
1361+
- In Workflow code, use https://python.temporal.io/temporalio.workflow.html#metric_meter
1362+
- In Activity code, use https://python.temporal.io/temporalio.activity.html#metric_meter
1363+
- In normal application code, use https://python.temporal.io/temporalio.runtime.Runtime.html#metric_meter
1364+
1365+
The attributes emitted by these default to `namespace`, `task_queue`, and `workflow_type`/`activity_type`; use
1366+
`with_additional_attributes` to create a meter emitting additional attributes.
1367+
1368+
#### Tracing
1369+
1370+
Tracing support requires the optional `opentelemetry` dependencies which are part of the `opentelemetry` extra. When
1371+
using `pip`, running
13511372

13521373
pip install 'temporalio[opentelemetry]'
13531374

0 commit comments

Comments
 (0)