pytracer-crewai
pyTracer adapter for CrewAI. It auto-instruments a crew through CrewAI's event bus,
so you do not add @op by hand: crew kickoffs, task and agent execution, tool
usage, and LLM calls are captured as pyTracer spans.
import pytracer_sdk as pytracer
from pytracer_crewai import PyTracerEventListener
pytracer.configure(
pytracer.HTTPTransport("https://gateway.internal", api_key="YOUR_KEY"),
service_name="my-crew", branch="main", commit="abc123",
)
PyTracerEventListener() # registers on the global bus; every crew run is now captured
crew.kickoff(inputs={...})
The bus stamps each event with an id, a parent id, and (on completion) the matching start id, which the listener uses to build a correctly nested trace.
Alongside other frameworks
CrewAI requires openai<3, so in the same environment the OpenAI Agents SDK is
capped at 0.20.0 (0.21 and later need openai>=3); pyTracer's OpenAI Agents
adapter supports 0.20.0. This adapter requires CrewAI 1.15.20 or later, the oldest
release it is tested with, so asking for openai-agents>=0.21 beside it is
reported as a conflict by pip and uv, instead of being settled by quietly
installing an old, untested CrewAI. CrewAI brings in googleapis-common-protos
twice, through opentelemetry-exporter-otlp-proto-http and through chromadb;
with AutoGen in the same environment, install both in one command, or pin
googleapis-common-protos<1.75.1, or CrewAI fails at import with a protobuf
VersionError. See
using several frameworks in one environment.
One trace per request
Each run starts its own trace. To keep a request that makes several runs, or also uses another framework, in one trace, wrap it in a pyTracer span; the run nests under the span that is open when it starts:
with pytracer.start_span("answer-question"):
crew.kickoff(inputs={...})
... # further runs, other adapters, or @op calls join the same trace
Replay
Call install_seams(listener) and a captured run replays without adding @op
to anything:
from pytracer_crewai import PyTracerEventListener, install_seams
listener = PyTracerEventListener()
install_seams(listener) # routes LLM calls and tools through pyTracer
crew.kickoff(inputs={...})
CrewAI's model calls (call / acall on every BaseLLM class, including the
native provider classes CrewAI loads lazily and custom LLMs) and tools
(BaseTool.run for native function calling, and the structured-tool invoke
used by the ReAct loop) then run through pyTracer, nested under the agent that
made them, so the replay engine can return their recorded results: in full mode
neither the model nor the tools run again, and in partial mode the tools stay
frozen while the model runs live. A model call is matched on its messages, the
tools offered and the response model. uninstall_seams() removes the routing
again.
CrewAI delivers events to listeners on a thread pool, so before a seam call the listener waits for already-emitted events (normally well under a millisecond, capped at 0.25 seconds) to nest the call under the right agent.
Without install_seams the adapter only captures, and replaying an
adapter-only trace is flagged (the run has recordings but hits no @op seam)
rather than silently running live. See the main README for the replay workflow.
Metadata
Release files for pytracer-crewai 0.1.4
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 | Actions |
|---|---|---|---|---|
| pytracer_crewai-0.1.4.tar.gz | 11.6 kB | With provenance | Details for pytracer_crewai-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytracer_crewai-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for pytracer_crewai-0.1.4-py3-none-any.whl |
Total release size: 20.5 kB
Release files / pytracer_crewai-0.1.4.tar.gz
| Download URL | pytracer_crewai-0.1.4.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f2522d4d6c145ee40eba0dfccfd59349c0ac02928ca6cbc5b0ce298e648c68e
|
|
BLAKE2b-256 checksum How to use checksums |
74f5be26d8101c14e70997cc66f5cb141a238f144de3131ef47e7c10d5665540
|
| 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 26, 2026.
Transparency logRelease files / pytracer_crewai-0.1.4-py3-none-any.whl
| Download URL | pytracer_crewai-0.1.4-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e132ccbb2b894733bd5557e1c072ed4f4e4e81e631b2dd7e6a0466a946c677b
|
|
BLAKE2b-256 checksum How to use checksums |
a966b3ab23b8867fcdfa885181624bfcd57cff183919baebefa69fdc18dcf957
|
| 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 26, 2026.
Transparency logSecurity for pytracer-crewai 0.1.4
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
Both files in this release have been uploaded with provenance metadata.
Attestation for pytracer_crewai-0.1.4.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 26, 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.