This feature is in early access and behind a feature flag. Contact your Augment Solutions Architect to enable it for your tenant
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’sgen_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 provisionalsession 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.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_tokensalready 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.
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 statusERROR 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.- In the next session, the
initialize linearspan fails witherror.type=mcp_authand the status message “MCP server rejected the credentials; reconnect or re-authorize it.” The span carries the expert’sgen_ai.agent.idandcosmos.trigger=schedule. - With Send metrics on,
cosmos.mcp.connection.failuresgoes up by 1 forerror.type=mcp_auth,cosmos.mcp.server.name=linear, the expert’sgen_ai.agent.idandcosmos.trigger=schedule. - With Send logs on, a
cosmos.agent.setupevent with severityERRORcarries the same values andcosmos.setup.step=initialize linear. - 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.