Slide 4 of 7

Control labels at the source

Filter at the source

You can keep unnecessary series from ever leaving your infrastructure with relabeling rules in Prometheus, Alloy, or your collector.

  • Allowlisting: keep an explicit set of important metrics and labels and drop everything else. For example, for Prometheus metrics, use keep and labelkeep actions.
  • Denylisting: drop an explicit set of high-cardinality metrics and labels and keep everything else. For example, for Prometheus metrics, use drop and labeldrop actions.

For the full relabeling reference and examples, refer to Reduce metrics costs by filtering collected and forwarded metrics.

Enforce your strategy at a gateway

Relabeling rules only help if you control the collectors that apply them. In larger organizations, many teams send telemetry, and the team that pays the bill often can’t control every client. In that case, route telemetry through a tier of gateway collectors that your platform or admin team owns, and apply your labeling and filtering policies at that layer. Whatever upstream teams send, your rules run at the gateway before data reaches Grafana Cloud.

Fleet Management helps you run this pattern at scale by giving you centralized control over your collector configurations, so you can roll out and update gateway policies from one place instead of editing collectors one by one.

Script

Prevention beats cleanup, and relabeling rules are the prevention tool. When you relabel metrics in Prometheus, in Grafana Alloy, or in whatever collector you run, unnecessary series never leave your infrastructure.

There are two basic postures. Allowlisting keeps an explicit set of important metrics and labels and drops everything else. Denylisting is the reverse, dropping an explicit set of high-cardinality metrics and labels and keeping the rest.

Relabeling rules only help if you control the collectors that apply them, though. In larger organizations, many teams send telemetry, and the team that pays the bill often can’t control every client.

One answer is to route telemetry through a tier of gateway collectors that your platform or admin team owns, and apply your labeling and filtering policies at that layer. Whatever upstream teams send, your rules run at the gateway before data reaches Grafana Cloud.

Fleet Management helps you run this pattern at scale. It gives you centralized control over collector configurations, so you can roll out and update gateway policies from one place instead of editing collectors one by one.