Skip to main content

OpenTelemetry tracing + metrics emitter for AgentForge

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentforge_otel-0.3.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentforge_otel-0.3.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file agentforge_otel-0.3.1.tar.gz.

File metadata

  • Download URL: agentforge_otel-0.3.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentforge_otel-0.3.1.tar.gz
Algorithm Hash digest
SHA256 dfb25ccccc022af0f00fbdde10302a655fb5f3ea8f2b5a4ea1f6cc79587644eb
MD5 f9e755ff36f7f25b351891059a71ddc1
BLAKE2b-256 3524ad21900ffd57ef52ca47e5e60c6195f2a1cf9abcad56f835e0ad6a0d3a50

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_otel-0.3.1.tar.gz:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentforge_otel-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: agentforge_otel-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentforge_otel-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 effc69fffc3dbb01ac7719f70c814b32107be0813d09ea6956e7af149d305087
MD5 e9ed29804175faaae80cb96bbe4dfff6
BLAKE2b-256 4f19d039e07d62c4f059f8e814ccd0ef26ba2e0865309f89333b6d3b12000ad2

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_otel-0.3.1-py3-none-any.whl:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page