Metadata-Version: 2.4
Name: opentelemetry-instrumentation-taskflow
Version: 0.10.0
Summary: OpenStack taskflow instrumentation for OpenTelemetry
Author-email: Pham Le Gia Dai <daipham3213@gmail.com>
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: opentelemetry-api
Requires-Dist: opentelemetry-instrumentation
Requires-Dist: opentelemetry-semantic-conventions
Requires-Dist: opentelemetry-util-http
Provides-Extra: instruments
Requires-Dist: taskflow; extra == 'instruments'
Description-Content-Type: text/markdown

# OpenTelemetry TaskFlow Instrumentation

OpenStack TaskFlow instrumentation for OpenTelemetry.

It records each engine execution as a root `taskflow.flow.run` span and each
atom `execute`/`revert` call as a child span, so a whole flow shows up as a
single trace:

```
taskflow.flow.run
  taskflow.task.execute
  taskflow.task.revert
  taskflow.retry.execute
  taskflow.retry.revert
```

Instead of patching atom methods, it uses TaskFlow's native notification API: it
attaches an OpenTelemetry [listener](https://docs.openstack.org/taskflow/latest/user/notifications.html)
to every engine's flow and atom notifiers. This observes work wherever it runs
(including the worker threads of the parallel engine) and keeps correct
parent/child linkage regardless of which thread executes an atom.

Spans are annotated with flow/atom names and UUIDs. Atom arguments and results
are never recorded.

## Usage

```python
from opentelemetry.instrumentation.taskflow import TaskflowInstrumentor

TaskflowInstrumentor().instrument()
```

Once instrumented, any engine you create — via `taskflow.engines.run()`,
`taskflow.engines.load()`, a flow factory, or directly — is traced
automatically.
