Skip to main content

agentforge-otel

OpenTelemetry tracing for AgentForge (feat-009).

The OTel API ships in agentforge-core — the framework emits spans unconditionally. Without this package, those calls degrade to NonRecordingSpan (near-zero cost). Installing agentforge-otel wires up the SDK, an OTLP exporter, and a sampler so the spans actually reach a collector.

Quick start

from agentforge import Agent
from agentforge_otel import OpenTelemetryHook

otel = OpenTelemetryHook(
    endpoint="http://otel-collector:4317",
    service_name="my-agent",
    sample_rate=1.0,
)

agent = Agent(
    model="bedrock:...",
    tools=[...],
    on_step=otel,
    on_finish=otel,
)

Constructing the hook installs the SDK provider once (idempotent). The framework's existing span emission then produces a tree per run:

span: agent.run
└── span: strategy.iteration
    ├── span: llm.call
    ├── span: tool.<name>
    └── span: evaluator.<name>

Span attributes carry agentforge.run_id, cost, token counts, finish reason, and step count — same correlation key the RunIdFilter puts on every log line.

Multiple backends

Run OTel alongside any other observer:

agent = Agent(
    model="...",
    on_step=[otel, my_statsd_hook],
    on_finish=[otel, persist_to_db],
)

Hooks fire in registration order; one hook's exception doesn't affect siblings (the framework logs WARN via agentforge.observability and keeps going).

Vendor compatibility

OTel is the wire format; any collector that ingests OTLP works: Datadog, Honeycomb, Jaeger, Grafana Tempo, SigNoz, New Relic. Point the endpoint at your collector's gRPC port (4317 by default).

Metadata

Release files for agentforge-otel 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentforge-otel 0.4.0
File Size Uploaded Provenance Actions
agentforge_otel-0.4.0.tar.gz 13.4 kB With provenance Details for agentforge_otel-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentforge-otel 0.4.0
File Interpreter ABI Platform Actions
agentforge_otel-0.4.0-py3-none-any.whl Python 3 none any Details for agentforge_otel-0.4.0-py3-none-any.whl

Total release size: 23.9 kB

Release files / agentforge_otel-0.4.0.tar.gz

Download URL agentforge_otel-0.4.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6e2242b2d0514a252d40ffa5f43d2944a9e13036836e5a97e6299510059bd18c
BLAKE2b-256 checksum
How to use checksums
9a1cb5aece1345d8ff1cec26e6eb7bc022bc349df5997edc03c2b6b25b1b679c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 24, 2026.

Transparency log

Release files / agentforge_otel-0.4.0-py3-none-any.whl

Download URL agentforge_otel-0.4.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b037fdb50662a352db13d4da751877a4af79a06f4f93e420c0b676765df13bc
BLAKE2b-256 checksum
How to use checksums
bc366134fa69608fb6ab5a51363f5f7b84413d4e458b54ba8e0e8da96cb2dea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 24, 2026.

Transparency log

Security for agentforge-otel 0.4.0

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.

Select from 2 files

Attestation for agentforge_otel-0.4.0.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 Jun 24, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page