Catalog PyPI
PACKAGE EXPLORERView in registry

agentmetrics-openai-agents

PyPI

AgentMetrics observability integration for OpenAI Agents SDK

agentmetricsai-agentsobservabilityopenaiopenai-agents
Versions collected1
Direct dependencies3From release 0.2.0
Last observed20 Oct, 22:43 UTC

README

Version 0.2.0 documentation

agentmetrics-openai-agents

PyPI License: MIT

AgentMetrics integration for the OpenAI Agents SDK. Register one trace processor at startup and every agent run reports back to your dashboard showing latency, cost, token counts, tool calls, and errors, with zero changes to your agent code.


Install

pip install agentmetrics-openai-agents

Quickstart

from agents.tracing import add_trace_processor
from agentmetrics_openai_agents import AgentMetricsProcessor

# register once at startup, covers all agents in the process
add_trace_processor(AgentMetricsProcessor(
    agent_id="my-openai-agent",
    base_url="http://localhost:8099",
))

# Run your agents as normal
result = await Runner.run(my_agent, "Summarize this document")

API

AgentMetricsProcessor(agent_id, base_url)

ParameterDefaultDescription
agent_id"openai-agent"Fallback label if the trace has no name attribute
base_url"http://localhost:8099"AgentMetrics server address

Implements TracingProcessor from agents.tracing. Pass to add_trace_processor() before running any agents.

.force_flush()

Blocks until all in-flight HTTP requests complete.

.shutdown()

Calls force_flush(). Called automatically when the process exits cleanly.


What gets tracked

Each agent trace emits one event to /v1/events when on_trace_end fires:

FieldDescription
statussuccess or failed
duration_msWall-clock trace duration
input_tokens / output_tokensAggregated from all LLMSpanData spans
cache_read_tokens / cache_write_tokensCache token counts
llm_callsNumber of LLM spans in the trace
tool_calls / tool_errorsCounts from FunctionSpanData spans
tool_namesSet of function/tool names
modelModel name from the first LLM span output
estimated_cost_usdComputed from token counts and model pricing
errorFirst 500 chars of the trace error on failure

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.020 Jun 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
andalabx/agentmetrics

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:43 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:773205e0e2514848daaab872c214986471e73290da1534d3fb713d2a6173e5bd