Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Label Whitelist #15577

Open
LukoJy3D opened this issue Jan 2, 2025 · 0 comments
Open

Feature request: Label Whitelist #15577

LukoJy3D opened this issue Jan 2, 2025 · 0 comments

Comments

@LukoJy3D
Copy link
Contributor

LukoJy3D commented Jan 2, 2025

Is your feature request related to a problem? Please describe.
Currently, Loki does not provide a native mechanism to restrict or whitelist labels at ingestion. With larger single-tenant deployments, simple human error or a lack of knowledge about how Loki deals with labels can cause the stream limit to be hit. I am aware of promtail and fluent-bit solutions to control this, but not everything can be covered with such preprocessing pipelines.

Describe the solution you'd like
Add a configuration option in Loki’s limits_config to define a label whitelist, such as:

limits_config:
  allowed_labels:
    - cluster
    - namespace
    - instance
  denied_labels: # Optional, to explicitly reject certain labels
    - kubernetes_pod_name
    - some_unique_id

If any other labels are sent, they are rejected.

Additional context
We had a case where one of the engineers with full access to Loki used a Python script with direct logging to Loki and created multiple high cardinality labels. Such cases are tough to predict, and even with various ACLs, this could still happen.

I see there already were minor thoughts about this: #8239 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant