← Back to Meter
AgentMeter
Cost reports with drill-down
Builds understandable cost reports whose totals lead to the underlying tasks, runs and immutable usage records.
cost-reporting-drill-down
See how it helpsWhen is it useful?
Use when users need to explain a spending total or compare the cost of completed work.
What does it help you do?
- Keeps organization, service, project and run breakdowns consistent with parent totals.
- Uses aggregated data for dashboards and detailed records for investigation.
- Shows freshness, currencies, units and estimated versus reconciled portions.
Try asking this
Design a cost dashboard that opens a tenant total into model costs, individual runs and the original ledger entries. Open one unusually expensive run from the monthly total. Its raw events, pricing version and adjustments should explain the amount without exposing other tenants.
Detailed documentation
Read the skill’s original instructions, examples and checks in their authored language.
Show less
Cost Reporting & Drill-Down
A cost number that cannot be drilled down to the exact tasks, agent turns, or storage buckets that produced it will not be trusted by users, operators, or finance teams.
Workflow
- Hierarchical drill-down without loss of consistency:
- Support seamless drill-down paths where every level sums to the exact parent total:
- Organization / Tenant Summary: Total direct cost, allocated cost, budget utilization %, and period-over-period delta.
- Service / Resource Breakdown: LLM inference vs. storage vs. bandwidth vs. background compute.
- Workflow / Project / Agent Breakdown: Which project, workflow, or agent role (
agentRole,model) consumed the budget. - Task & Run Trace: Individual
taskId/runIdwith turn-by-turn token progression, cache hit rate, retries, and duration. - Raw Ledger Entries: The underlying immutable events with
occurredAt,rateVersionId,certainty, andproviderRequestId.
- Support seamless drill-down paths where every level sums to the exact parent total:
- Query pre-aggregated rollups for dashboards; raw ledgers for trace inspection:
- Serve time-series charts (
hourly,daily,monthly) and top-N leaderboards from pre-aggregated rollup tables indexed by(tenant_id, bucket_start, service, model, agent_role)so dashboard queries return in milliseconds regardless of raw event volume. - Coordinate with the database specialist on composite indexes and partitioning, and with the data visualization specialist so time-bucket boundaries, currency formatting, and unit labels (
tokens,GB-month,USD) are unambiguous.
- Serve time-series charts (
- Surface data freshness, certainty, and unit economics:
- Include metadata on every report response:
asOfTimestamp/watermarkTimestamp: How fresh the rollup data is.estimatedShareMicrosvs.providerReportedMicrosvs.reconciledMicros: Clearly badge any portion of recent spend that still relies on local estimates.
- Compute actionable unit-economics metrics:
- Average and P95 cost per task / per run / per active workspace.
- Cache savings (
listCostWithoutCacheMicros - actualCostMicros) so teams can see the concrete dollar return of prompt caching and model routing optimizations.
- Include metadata on every report response:
Anti-Patterns to Avoid
- Running
SUM()over tens of millions of raw events on every dashboard page load: Always use incremental rollups for overview ranges and reserve raw event queries for single-run drill-downs or export jobs. - Many-to-many join fan-out in reporting SQL: Joining usage events directly to multi-row tag or membership tables without pre-aggregating inflates reported spend by the number of joined rows.
Included files 1
SKILL.md
