Skip to main content
This feature is in early access and behind a feature flag. Contact your Augment Solutions Architect to enable it for your tenant
Everything Cosmos sends has service.name = augment-cosmos. Start every query with that filter.

Find a session

Sort a session’s spans by start time to read it in order.

A run started by another session

When an agent delegates to a worker in another session, the worker’s run span has a link to the tool call that started it. The link’s gen_ai.conversation.id attribute holds the calling session’s ID, so you can jump between the two traces.

The session span can arrive twice

While a session is open, Cosmos sends a provisional session span when its first run ends, and again when a later run ends at least 5 minutes after the last copy, so the session span covers its runs before the session is over. When the session ends, Cosmos sends the final session span with the same trace ID and span ID and the real end time. If work resumes later, it’s sent once more. Most trace views show only the latest copy. Span search and span counts may count every copy: to count sessions, use cosmos.session.count or cosmos.session.start events instead of session spans, and for session duration use the copy with the latest end time.

Count tokens and cost

Use the metrics if you can. They’re already aggregated and count each token once.
Subagents’ model requests aren’t traced yet, so every Trace Export usage and cost total, from metrics, spans or log events, leaves out subagent inference. For billing, use your Augment invoice and usage reports.
cosmos.cost.usage is sent only for organizations billed in US dollars. Credits and cost are what Augment records for each request; your invoice remains the source of truth. To count tokens from spans, sum gen_ai.usage.* over chat spans. Only the spans of individual attempts carry usage, so a retried request’s parent span is never double-counted.
  • gen_ai.usage.input_tokens already includes tokens read from and written to the prompt cache. Don’t add the cache attributes to it.
  • Spans can arrive more than once after a retry. If your platform doesn’t remove duplicates, count each span once by trace ID and span ID.
To cost a session or run from traces, sum cosmos.credits or cosmos.cost_usd over its chat spans. Like usage, they’re on attempt spans only. The cosmos.api.request and cosmos.api.error log events carry the same values per request. Group by gen_ai.response.model rather than gen_ai.request.model: a request for the default model has no requested model, and a request can be served by a different model than the one requested.

Build dashboards

Useful panels, mostly from metrics: Metrics are cumulative and sent every 60 seconds from each Cosmos server instance (service.instance.id). Use rate or increase functions and sum across instances. See Aggregating metrics.

Set up alerts

Every failed span has status ERROR and an error.type.

Example: an expert’s MCP credentials expired

An expert runs every night on a schedule and uses a Linear MCP server. Its Linear token expires.
  1. In the next session, the initialize linear span fails with error.type = mcp_auth and the status message “MCP server rejected the credentials; reconnect or re-authorize it.” The span carries the expert’s gen_ai.agent.id and cosmos.trigger = schedule.
  2. With Send metrics on, cosmos.mcp.connection.failures goes up by 1 for error.type = mcp_auth, cosmos.mcp.server.name = linear, the expert’s gen_ai.agent.id and cosmos.trigger = schedule.
  3. With Send logs on, a cosmos.agent.setup event with severity ERROR carries the same values and cosmos.setup.step = initialize linear.
  4. An alert on the metric or the event, grouped by server and expert, says which expert’s scheduled run lost which server. No join is needed.

Send data to more than one place

Each destination receives its own copy, so you can, for example, send metrics to Datadog and full content to Langfuse. To send to many backends, filter or transform the data, or reach a private backend, run your own OpenTelemetry Collector as a destination and route from it.