respan-instrumentation-anthropic
Respan instrumentation plugin for the Anthropic Python SDK.
This package patches Anthropic client calls and emits spans using the Respan/Traceloop GenAI attribute shape used across this repository.
Install
pip install respan-instrumentation-anthropic
Quickstart
import os
from anthropic import Anthropic
from respan import Respan
from respan_instrumentation_anthropic import AnthropicInstrumentor
respan = Respan(
api_key=os.environ["RESPAN_API_KEY"],
instrumentations=[AnthropicInstrumentor()],
)
client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
message = client.messages.create(
model="claude-3-5-haiku-latest",
max_tokens=128,
messages=[{"role": "user", "content": "Write one line about tracing."}],
)
print(message.content)
respan.flush()
Notes
- The instrumentor patches both
AnthropicandAsyncAnthropic. messages.create()and streaming responses are traced.- Managed agent session streaming is also captured when available through the Anthropic SDK.
Metadata
Release files for respan-instrumentation-anthropic 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| respan_instrumentation_anthropic-1.0.3.tar.gz | 11.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| respan_instrumentation_anthropic-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.6 kB
Release files / respan_instrumentation_anthropic-1.0.3.tar.gz
| Download URL | respan_instrumentation_anthropic-1.0.3.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bac8a46981ee6dc5525b0456a2780a9f5950dc34a42d0c85c8fe146555dc67dc
|
|
BLAKE2b-256 checksum How to use checksums |
ea3ea2dd0ba1d3e6d9592c8991d8f2419c41cf2d78a77ae2c9ab1e6fa890c8a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 21, 2026.
Transparency logRelease files / respan_instrumentation_anthropic-1.0.3-py3-none-any.whl
| Download URL | respan_instrumentation_anthropic-1.0.3-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7dec85491a3d1ce0ccc2787724c245ba1b9708096f7d5493307f7d5a2241220
|
|
BLAKE2b-256 checksum How to use checksums |
c5ea85eb6dee050c4a00d1c0430c2eee07560b229296c2dc7881e0e9e03471db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 21, 2026.
Transparency log