Skip to main content

Runtime Visibility & Metrics

Monitor your agents with built-in metrics, telemetry streams, and in-house trace summaries.

Real-time Usage Metrics

OmniCoreAgent tracks request counts, runtime, and provider-reported token usage when available. Each run() returns a metric object, and you can get cumulative stats anytime.

Runtime Metrics

OmniCoreAgent exposes lightweight runtime metrics without requiring an external tracing service.

What’s Available

  • Request count
  • Request, response, and total tokens
  • Total runtime
  • Average response time

Telemetry Events

OmniCoreAgent emits typed telemetry events for user messages, tool calls, tool results, final answers, subagent calls, and background run lifecycle changes. Use events when you need a live UI, session debugging, or a lightweight execution record.
When serving through OmniServe, POST /run streams the live run over SSE. For application UIs and APIs, use the /telemetry routes to replay, inspect, and stream stored telemetry. Filter by run_id when a UI needs to isolate one execution inside a shared session. The compact /events/{session_id} aliases are still available and accept ?run_id=... for the same run-scoped isolation.

Agent Trace

Every run emits typed telemetry. Retrieve the trace by the trace_id returned from agent.run(...).
You can also retrieve the latest trace for a session or a trace correlated to a run:
trace_id is the exact trace handle. run_id is a correlation and filtering handle; when more than one trace is correlated to the same run, get_trace( run_id=...) returns the latest matching trace. The trace is intentionally dependency-free inside the runtime. Exporters are optional adapters layered on top of this internal trace model.

Export Traces

Install the OpenTelemetry extra when you want to send traces to an OTLP collector or an OTLP-compatible tracing backend:
Export a specific trace manually:
Configure exporters on the agent to export automatically when traces end:
Vendor presets use the same OTLP exporter path:
The presets also read common environment variables: trace_id remains the exact lookup and export handle. run_id can be used for correlated export, but when a serving trace and an agent trace share the same run_id, the latest matching trace is exported.
Use metrics for cost and performance monitoring, events for live UI streaming, traces for debugging, and exporters when traces need to leave the process.