This release is a pre-release and may not be stable for production use.
OpenTelemetry QwenPaw Instrumentation
This library traces user turns handled by QwenPaw, a personal assistant application built on AgentScope. Each turn that goes through AgentRunner.query_handler produces one invoke_agent span following the OpenTelemetry GenAI semantic conventions, carrying the agent display name (gen_ai.agent.name, when already cached by the runner), the session id (gen_ai.conversation.id), and — when content capture is enabled — the turn’s input and output messages.
The request’s session ID is propagated to nested GenAI invocations through OpenTelemetry context.
The span remains open until the response stream is drained or closed. Successful finalization records gen_ai.response.finish_reasons when the last emitted assistant message is complete. Closing a partial message preserves captured output without reporting a finish reason. Local agent turns record the gen_ai.invoke_agent.duration metric.
Abandoning a partially consumed stream ends its span during garbage collection with error.type set to _OTHER and the status description abandoned stream. Captured partial output is preserved without reporting a finish reason. This requires opentelemetry-util-genai 1.3b0 or newer (1.3b0.dev from this workspace during development).
QwenPaw delegates model (LLM) and tool execution to AgentScope, so this package emits no chat or execute_tool spans and its conformance suite covers none — those operations belong to the AgentScope instrumentation. Pair this package with the instrumentations of AgentScope and the underlying model libraries so their calls appear as child spans under the invoke_agent span.
Supported versions
QwenPaw 1.1.x only. The 2.x runtime architecture upgrade refactored away AgentRunner.query_handler, the seam this package patches, so the dependency is capped at < 2.0.0 and 2.x support will be added separately against the new runtime entry point.
Installation
pip install opentelemetry-instrumentation-genai-qwenpaw
Usage
QwenPaw is started as its own app (CLI / process entrypoint). Use OpenTelemetry zero-code instrumentation (opentelemetry-instrument qwenpaw app) — check out the zero-code example for a quick start — or, if you control an embedding process, instrument programmatically:
from opentelemetry.instrumentation.genai.qwenpaw import QwenPawInstrumentor
QwenPawInstrumentor().instrument()
# ... run the QwenPaw app in this process ...
QwenPawInstrumentor().uninstrument()
Check out the manual example for more details.
Configuration
Capture Message Content
By default, input and output messages are not captured. To capture message content, set the environment variable OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT to one of NO_CONTENT, SPAN_ONLY, EVENT_ONLY, or SPAN_AND_EVENT:
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=SPAN_AND_EVENT
Uploading prompts and completions
Instead of recording message content inline, prompts and completions can be uploaded to external storage via a completion hook. To enable the built-in upload hook, set:
OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload
OTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATH to an fsspec-compatible URI/path (e.g. /path/to/prompts or gs://my_bucket), and install the upload extra (pip install opentelemetry-util-genai[upload]).
A custom CompletionHook can also be passed programmatically, taking precedence over the environment variable:
QwenPawInstrumentor().instrument(completion_hook=my_hook)
See examples/manual/custom_hook.py for a runnable custom-hook example.
Conformance
Semantic-convention conformance scenarios live in tests/conformance.
References
Metadata
Release files for opentelemetry-instrumentation-genai-qwenpaw 1.3b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| opentelemetry_instrumentation_genai_qwenpaw-1.3b0.tar.gz | 19.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opentelemetry_instrumentation_genai_qwenpaw-1.3b0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.4 kB
Release files / opentelemetry_instrumentation_genai_qwenpaw-1.3b0.tar.gz
| Download URL | opentelemetry_instrumentation_genai_qwenpaw-1.3b0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbd1c5b27126edf8c8dd4bb3c5b63ccdcec758fb21b16f95be599dc5f4c3b750
|
|
BLAKE2b-256 checksum How to use checksums |
5f701587720c785754f16a18fa4b7446afa2dd6729f3469ae78a2ef6f5645bf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logRelease files / opentelemetry_instrumentation_genai_qwenpaw-1.3b0-py3-none-any.whl
| Download URL | opentelemetry_instrumentation_genai_qwenpaw-1.3b0-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04e24be049b1692cdd8d9054d37250ad0f1a3dc10b1eeed1f728bc05bd649447
|
|
BLAKE2b-256 checksum How to use checksums |
8afb11a4e0736b7d927b7ca1c322603a7d9dcdffaadacaa2ec020ded950827a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logSecurity for opentelemetry-instrumentation-genai-qwenpaw 1.3b0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for opentelemetry_instrumentation_genai_qwenpaw-1.3b0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.