ARTICLE - Monitoring & Alerting

Grafana Cloud Cost Attribution: Splitting Observability Spend by Team

Knowing what you spend on observability is useful, but only knowing which team or service drives that spend lets you act. The difference is a total invoice versus an itemised statement.

2026-08-05 Grafana Blog

Grafana Cloud Cost Attribution: Splitting Observability Spend by Team

Knowing what you spend on observability is useful, but only knowing which team or service drives that spend lets you act. The difference is a total invoice versus an itemised statement: the first produces anxiety, the second produces decisions.

On cloud servers, cost tracks the number of machines. Scaling up, scaling down, and decommissioning all move the bill linearly, so intuition gets you roughly right. Observability is nothing like that: its bill follows how much you collect, how long you keep it, and how much you query — quantities that grow with the business, shift with label design, and jump on a single commit. Treating it as another class of server cost is almost guaranteed to misjudge the direction.

This article follows "understand the structure, then govern": why the four metering dimensions are unrelated to server count, how series counts explode, a four-step attribution method, remedies ordered by speed of effect, the levers specific to logs and traces, and finally three anti-patterns plus the test for whether governance has become routine. For the wider selection context, see cloud monitoring services compared; this piece is about where the money goes and how to make it legible.

1. Cost Structure: Series and Retention, Not Servers

Treating observability as "another kind of server" is the first common mistake. Servers bill by uptime and instance size; observability bills by data volume and how long that data exists inside the system — two completely different responses to business growth.

1.1 The four metering dimensions

Most observability systems meter four things: active time series, log ingestion volume, retention period, and query volume. What they share is that they scale with collection, not with machine count.

Active series is the most underestimated. Its unit is not "number of metrics" but "number of combinations of a metric with all label values". Adding a metric is cheap; adding a high-cardinality label to an existing metric is expensive. Log ingestion is metered by bytes or lines, grows with request volume, and is hard to compress because it records what actually happened. Retention is a multiplier: the same log volume kept twice as long occupies twice as much. Query volume creeps up quietly with more dashboards, faster refresh, and longer time ranges.

Settle these four and a counterintuitive conclusion follows: consolidating from ten machines to three barely moves the bill, while deleting one high-cardinality label can drop it a whole step.

1.2 Why adding machines is not the main cost

Machines are countable, so people have intuition about machine cost. Data volume is not countable, especially when it is the product of metrics, label combinations, and time — and intuition about that product is essentially zero.

A concrete comparison makes the point. Cut the fleet in half and you halve the collectors, so metric volume does halve. But if someone adds a user-ID label to one metric in the same period, series count multiplies by the number of users — both changes happen at once and the bill may go up. When someone then asks why cost reduction did not work, the answer is not in the cost-cutting actions but in the fact that nobody knew which line dominated the bill.

That is why attribution must precede governance. Cutting cost without attribution is doing subtraction on a ledger whose structure you cannot see. The basic mechanics of metrics and labels are covered in Prometheus and Grafana basics.

2. Why Series Counts Explode

Series count is the most commonly misjudged item on an observability bill because it does not grow by addition. It grows by multiplication.

2.1 The identity of a series

A time series is uniquely determined by its metric name plus the combination of all label values. requests_total{service="api", status="200"} and requests_total{service="api", status="500"} are two entirely separate series, each with its own memory, index entry, write bandwidth, and charge.

So series count equals the number of metric names multiplied by the value counts of every label. That product structure decides one thing: growth in any single label's value count amplifies every series. Three labels with a hundred values each produce a million combinations — even if the metric itself took three lines of code to emit.

The usual sources of high cardinality: user IDs, request IDs, full URLs including query strings, order numbers, session identifiers, client IPs, and raw error messages. Their shared property is that their value count is of the same order as business volume — and business volume grows.

2.2 Why such labels keep getting added

They get added not because someone misunderstands the theory, but because in a specific moment they genuinely help: debug one user's request, reproduce one order's problem, isolate a slow endpoint by URL. Putting the value in a metric label is the least effortful thing to do right then.

The problem is a timing mismatch between cost and benefit. The benefit is realised the same day — you can query it; the cost is realised months later — the bill and query latency. Nothing warns you in between, because "too many labels" is not a failure any system detects automatically.

An extremely cheap preventive measure is to separate the two jobs: when you need to locate something by a high-cardinality dimension, go to logs or traces; keep metrics limited to aggregates that can be drawn as a line. That boundary is almost never controversial, but it has to be recalled at each "let me just add a label" moment, so it must be written down as a convention rather than remembered.

3. Attribution: From Counting to Allocation

Attribution is not dividing the bill by the number of teams; that is allocation, not attribution. Attribution answers which usage was produced by whom, and whether it was necessary. The four steps below form an executable order.

3.1 Step one: count active series per job and per metric name

Start with pure counting: right now, how many active series does each collection job and each metric name contribute. This needs no new tooling — one query produces a ranking, which is one of the best-value uses of a display layer such as Grafana; it does far more than draw charts.

Two findings usually surface. First, concentration is extreme: a handful of metrics contribute most of the series, and they are often not the ones the team expected. Second, some metrics owe their count to a label nobody remembers, possibly left behind by one historical investigation.

The output is a "top series" list. It deserves to be re-run periodically, because it changes with the business while people's impressions do not.

3.2 Step two: cross series count with query frequency

A metric with many series and almost no queries is the purest waste available: it consumes storage and compute continuously while producing no decision. Such metrics are usually a substantial share of the list, because "added and forgotten" is the most common lifecycle.

The crossing is simple: series count per metric (or per label combination) on one side, references from dashboards, alert rules, and ad-hoc queries on the other. Placed side by side, metrics fall into four groups: high volume and high query (keep), high volume and low query (govern first), low volume and high query (keep — probably critical but sparse), low volume and low query (remove while you are there).

There is a side benefit: this step reveals what dashboards and alerts actually reference. For many teams it is the first time they learn that a meaningful share of collected metrics has never been cited by any rule or panel.

3.3 Step three: attach ownership labels and allocate the bill

Step three is attaching ownership labels at the collection side: team, environment, service, project. Ownership labels are low cardinality, so their own cost is negligible, yet they give every later statistic a dimension.

Aggregate usage by label value and allocate the bill to teams. The critical effect is behavioural rather than financial: the first time cost appears on a team's own report rather than in the platform team's total, governance starts happening on its own, because that team knows what the metrics are for and has a motive to drop the unused ones.

Allocation only works if label coverage is high. Data without ownership labels becomes an "unattributed" pool, and the larger the pool, the less persuasive the allocation. So the unattributed share deserves to be tracked as a metric in its own right, with a ceiling attached to it.

3.4 Step four: compare what is collected against what is referenced

The final step places two lists side by side: everything currently collected, and everything actually referenced by alert rules and dashboards. The difference is the trimmable portion.

That difference is usually larger than expected. Collection configs tend to be "set once and never revisited", while dashboards and rules are edited and deleted as needs change. Collection only grows, references both grow and shrink, so the two must diverge.

Watch for one special case: some metrics are unreferenced today but needed as raw material during diagnosis. Keep those, but require an explicit written reason — otherwise the next governance round treats them as dead weight. Writing down the reason is harder than keeping the data, and more important.

4. Remedies Ordered by Speed of Effect

Order matters here because the value of each remedy differs sharply, and the ones that come to mind first are usually the ones that hurt most. The sequence below runs from fastest to slowest effect.

Order (by speed of effect) Remedy Risk Prerequisite to confirm first
Step 1 Delete metrics that have never been queried Lowest risk; changes nothing for existing dashboards and alerts Confirm no query or rule references them
Step 2 Remove high-cardinality labels: full URLs to path templates, user identifiers out of metric labels into log fields Requires changing collection config Confirm no existing rule depends on that label
Step 3 Downsample and pre-aggregate: recording rules for long-range queries, raw detail kept only for a short window Sacrifices some retrospective capability Decide in advance which dimensions will be needed after the fact
Step 4 Shorten retention, applied as tiers: full detail recently, aggregates for the middle period, audit-only long term Damages diagnostic ability most directly Incidents are often only fully reviewed days later

4.1 The four steps

First, delete metrics that have never been queried. Fastest effect, lowest risk, because it changes nothing for existing dashboards and alerts. This step alone usually recovers a substantial share of usage.

Second, remove high-cardinality labels. Replace full URLs with path templates, move user identifiers out of metric labels into log fields. The payoff is larger, but it requires changing collection config and confirming no existing rule depends on that label.

Third, downsample and pre-aggregate. Use recording rules for long-range queries so only the required aggregation granularity is retained rather than raw detail. Keep raw data only for a short window and express long-term trends through aggregates. This step sacrifices some retrospective capability, so decide in advance which dimensions will be needed after the fact.

Fourth, shorten retention. It comes last because it damages diagnostic ability most directly — incidents are often only fully reviewed days later, and by then the data may be gone.

4.2 Why retention must come last

Retention is a multiplier, so shortening it looks like the biggest, easiest lever: change one number, cut the bill. Which is exactly why it is the most common anti-pattern.

The real cost is hidden. What you lose is not "data" but the ability to answer certain questions. A question asked three months later — was last quarter's slow query the same root cause as this one, where was the capacity inflection six months ago — becomes permanently unanswerable once retention has been cut. And such questions are often worth more than daily queries, because they point at structural improvement.

The right approach is tiering: full searchable detail recently, aggregates only for the middle period, audit and compliance data long term. Tiering turns "shorten retention" from a blunt cut into a set of deliberate trade-offs, with a bounded cost.

5. Cost Levers for Logs and Traces

Beyond metrics, logs and traces are usually the fastest-growing parts of the bill, because they record detail and detail is proportional to request volume. Their remedies differ from metrics: the core idea is routing items into different buckets rather than deleting them.

5.1 Logs: split by level, tier retention, archive cold

The first lever is splitting by level: keep error-level records in full, sample or skip normal and debug traffic. The payoff is large, because info-level records usually dominate structured logs while contributing far less than error-level records to incident review.

The second is shortening hot retention. The window that must be instantly searchable is finite; anything older goes to cold storage — slower to query, much cheaper, still present. The third is an archiving strategy: audit and compliance logs travel on their own pipeline, separate from diagnostic logs, so each side's retention can be set for its own purpose instead of compromising.

All three share one property: classify first, then act. Compressing without classifying applies the same reduction to useful and useless data alike, and the result usually satisfies neither goal. Aggregation and query techniques on the log side are in log aggregation and query.

5.2 Traces: raise the sampling quality, keep slow and failed requests

Trace cost tracks sampling rate, so lowering the rate is the instinctive move. But uniform downsampling creates a serious problem: it drops samples proportionally, and failures are exactly the rare samples — so the traces you most need are the first to go.

The right approach is priority sampling: retain slow requests and failed requests in full, sample normal requests proportionally. That caps volume while preserving diagnostic value, because the traces you actually open are almost always slow or broken.

Tail sampling — deciding after the request completes — implements this logic, at the cost of buffering and a more complex pipeline. A lighter approach is tagging at the application side by response time and status code, letting the collector decide from those tags. Which to choose depends on how much control the team has over the pipeline; the mechanisms are described in APM and distributed tracing.

6. Three Anti-Patterns

All three share a signature: effective in the short term, guaranteed to rebound in the long term, and harder to handle after the rebound than before the cleanup.

6.1 Turning governance into a one-off campaign

The first is campaign-style governance: the bill spikes, a task force forms, two weeks of deleting everything deletable, the bill drops, the project closes. Three months later the bill is back where it started, and nobody wants to do it again.

The rebound is easy to explain: collection demand keeps being generated. New services add metrics, new investigations add labels, new dashboards add queries. Deletion is one-off, growth is continuous, and the two slopes can never stay equal for long.

The only real fix is making governance routine: a budget, an owner, and a fixed review cadence. That is the subject of the final chapter.

6.2 Cutting retention first

The second is cutting retention first. It shows results fastest, so it gets selected first under pressure; it damages the ability to answer lagging questions, so its cost is perceived last.

What makes it insidious is the quiet aftermath: after the cut, daily queries work, dashboards refresh, nothing feels wrong. Only when a question requires looking back does the answer turn out to be gone — and that question is often "why does this failure look so much like the last one".

6.3 Treating "switch to a cheaper product" as the only lever

The third is switching products: the bill is high, so migrate to a lower-priced one. Two problems. First, definitions differ — two products may define "a series" or "a query" differently, so a lower unit price does not mean a lower total. Second, migration cost is underestimated: alert rules, dashboards, SLOs, and collection configs all get rewritten, and the coverage gap during the rewrite plus the team's learning curve are real cost.

Switching can be part of governance, but it should never be step one. First find the waste inside your own system and clean up the labelling, then talk about migrating — otherwise you carry identical waste to a new vendor and the bill structure does not change.

7. Making Governance Routine

Every remedy above needs an organisational carrier to hold up over time. This chapter offers the minimum viable mechanism rather than a complete process.

7.1 Three fixed actions

First: set a budget. Give observability an allowance tied to business scale, broken down by team. The purpose is not to limit usage but to make changes in usage visible.

Second: set an owner. Every data class needs someone responsible — who decides whether this metric should be collected, who can answer why this label is here. Data without an owner cannot be judged during governance, because nobody can say whether it should be deleted.

Third: review the top series every month. The action costs almost nothing and yields a lot: it makes "who added what, and when" visible, and visibility is the strongest constraint available.

Together these three turn governance from "a project triggered by a problem" into "part of the routine". They need no new tooling, only someone doing them on a schedule.

7.2 An executable monthly checklist

  • Review this month's usage against budget and the main driver of any variance
  • Re-run the top series list and check whether the head has shifted
  • Check the unattributed share and push for missing labels when it exceeds the ceiling
  • Spot-check three to five low-query metrics and confirm the written reason still holds
  • Audit newly added high-cardinality labels and confirm whether an aggregate would do
  • Compare alert rules and dashboards against actual references, and refresh the trimmable list
  • Confirm retention tiers still match diagnostic needs

The point is not to complete every item but to give cost a fixed place, so it is not only remembered when the invoice arrives. Baseline and metric-definition consistency can be maintained alongside the SLO/SLI template; alert-side trade-offs are in monitoring and alerting from scratch; and the test for which metrics deserve to stay is in what to monitor.

There is exactly one test for whether governance has become routine: can you explain, every month and without an invoice shock, how much usage grew, why, and what you intend to do next. If you can, it is a mechanism. If you cannot, it is still a series of campaigns.

Source: Grafana Labs official blog and Grafana Cloud cost management documentation; compiled and interpreted by 16IDC. Billing definitions and product behaviour follow Grafana Labs' official documentation.

Integration & Code Examples

Example 1: Pin down per-team active series with recording rules

# Keep cardinality as a long-lived metric in Grafana Cloud or Prometheus
groups:
  - name: cost-attribution
    interval: 5m
    rules:
      # 1) Active series per team, sampled every minute for later hourly integration
      - record: team:series_active:sum
        expr: |
          count by (team) (
            count by (__name__, team) ({__name__=~".+", team!=""})
          )
      # 2) Samples scraped per team per minute: write pressure, not just series count
      - record: team:samples_scraped:sum
        expr: |
          sum by (team) (
            rate(scrape_samples_scraped[5m]) * 60
          )

Series count drives the bill while sample rate drives write pressure; watch both to explain why the invoice moved without cardinality moving.

Example 2: Count log bytes per namespace with logcli

# Credentials come from the environment only, never from the script itself
export LOKI_ADDR="https://logs-prod-000.grafana.net"
export LOKI_USERNAME="$GRAFANA_LOKI_ID"
export LOKI_PASSWORD="$GRAFANA_TOKEN"

# Bytes per namespace over the last 24 hours, ready for team allocation
logcli query \
  --from="24h" --limit=0 --output=raw \
  'sum by (namespace) (bytes_over_time({namespace=~".+"} [1h]))'

# Find the most expensive streams first, then decide on retention or sampling
logcli query --from="24h" --limit=20 \
  'topk(20, sum by (namespace, app) (bytes_over_time({namespace=~".+"} [1h])))'

Log cost tracks bytes almost linearly, so a per-namespace topk is far closer to reality than splitting raw log counts per person.

Limitations

  • Cutting cost without attribution is doing subtraction on a ledger whose structure you cannot see.
  • Series count is the most commonly misjudged item on an observability bill because it does not grow by addition.
  • It deserves to be re-run periodically, because it changes with the business while people's impressions do not.
  • So the unattributed share deserves to be tracked as a metric in its own right, with a ceiling attached to it.
  • Collection only grows, references both grow and shrink, so the two must diverge.

FAQ

What prerequisites does cost attribution require?

Ownership labels on the collection side. Team, environment, service and project are 4 low-cardinality labels, so adding them costs almost nothing. Without enough coverage the bill falls into an unattributed pool nobody trusts, so fix labels first and put a ceiling on the unattributed share.

Series are flat but the bill rose — where do you troubleshoot?

Start with ingested sample rate, not series count. The same series scraped more often leaves the count unchanged while write pressure climbs. Record both series count and sample rate in one rule, then use logcli to total bytes per namespace over 24 hours and see which signal moved.

How should Loki credentials be stored?

Read them from environment variables only. logcli takes LOKI_ADDR, LOKI_USERNAME and LOKI_PASSWORD, and the token should carry the narrowest scope that works. If credentials ever reached a repository, rotate them and retire the old token within 24 hours, because anyone with read access can export logs.

Related Providers

  • Grafana Cloud: when the invoice is already split into active series, log volume and retention, reconcile each of the four lines per team with its stack and data source usage reports.
  • Prometheus: when a series spike has to be traced back to collection, inspect target and label cardinality here first.
  • Datadog: when pricing units are about to change or a migration needs a baseline, compare billing units and retention settings across its products.

Community & Resources

Learning resources and tools

Original source: Grafana Blog ↗