-
Notifications
You must be signed in to change notification settings - Fork 89
Evolve observability documentation #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
481ca7c
2c63456
b636d3a
832e30d
434a314
5ef02ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,9 @@ informal introduction to the features and their implementation. | |
- [Worker Shutdown](#worker-shutdown) | ||
- [Testing](#testing-1) | ||
- [Workflow Replay](#workflow-replay) | ||
- [OpenTelemetry Support](#opentelemetry-support) | ||
- [Observability](#observability) | ||
- [Metrics](#metrics) | ||
- [OpenTelemetry Tracing](#opentelemetry-tracing) | ||
- [Protobuf 3.x vs 4.x](#protobuf-3x-vs-4x) | ||
- [Known Compatibility Issues](#known-compatibility-issues) | ||
- [gevent Patching](#gevent-patching) | ||
|
@@ -1344,10 +1346,30 @@ async def check_past_histories(my_client: Client): | |
) | ||
``` | ||
|
||
### OpenTelemetry Support | ||
### Observability | ||
|
||
OpenTelemetry support requires the optional `opentelemetry` dependencies which are part of the `opentelemetry` extra. | ||
When using `pip`, running | ||
See https://github.com/temporalio/samples-python/tree/main/open_telemetry for a sample demonstrating collection of | ||
metrics and tracing data emitted by the SDK. | ||
|
||
#### Metrics | ||
|
||
The SDK emits various metrics by default: see https://docs.temporal.io/references/sdk-metrics. To configure additional | ||
attributes to be emitted with all metrics, pass | ||
[global_tags](https://python.temporal.io/temporalio.runtime.TelemetryConfig.html#global_tags) when creating the | ||
[TelemetryConfig](https://python.temporal.io/temporalio.runtime.TelemetryConfig.html). | ||
|
||
For emitting custom metrics, the SDK makes a metric meter available: | ||
- In Workflow code, use https://python.temporal.io/temporalio.workflow.html#metric_meter | ||
- In Activity code, use https://python.temporal.io/temporalio.activity.html#metric_meter | ||
- In normal application code, use https://python.temporal.io/temporalio.runtime.Runtime.html#metric_meter | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a bit confused, where does normal application code exist if not in a workflow or activity? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where they use the client in non-activity situations, e.g. a client interceptor or anywhere they use the client (but really they probably should use their favorite metrics client/system instead of using Temporal's, but meh) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way I describe it to people is that a codebase using Temporal has 3 distinct categories of code that involve Temporal: workflow code, activity code, and "normal application code" that is using a Temporal client to start and interact with workflows, issue other queries, create schedules etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks both, helpful :) |
||
|
||
The attributes emitted by these default to `namespace`, `task_queue`, and `workflow_type`/`activity_type`; use | ||
`with_additional_attributes` to create a meter emitting additional attributes. | ||
|
||
#### OpenTelemetry Tracing | ||
|
||
Tracing support requires the optional `opentelemetry` dependencies which are part of the `opentelemetry` extra. When | ||
using `pip`, running | ||
|
||
pip install 'temporalio[opentelemetry]' | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need to run
npx doctoc README.md
, unsure