Skip to content

Prometheus Rate Limit #6844

Description

@opencow

Component(s)

prometheus.scrape

Background

Today, relabeling can statically keep or drop samples based on labels, but it cannot rate-limit samples by label value.
Our use case is an Alloy deployment that scrapes metrics from multiple products. A single noisy product can affect metric ingestion for other products. We’d like to apply independent rate limits using a label such as product or namespace.

Proposal

A new rate limit component prometheus.limit, taking inspiration from the loki.process's stage.limit configurations.

prometheus.limit "metrics" {
  forward_to         = [prometheus.remote_write.mimir.receiver]
  rate               = 1000
  burst              = 2000
  drop               = true
  by_label_name      = "namespace"
  max_distinct_labels = 10000
}

Will put out a PR if the proposal is considered!

AI disclosure

  • This issue was substantially generated with AI assistance.

Tip

React with 👍 if this issue is important to you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Incoming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions