Skip to content

Conversation

@slim-bean
Copy link
Collaborator

What this PR does / why we need it:

Loki understands key=value pairs being passed via the X-Query-Tags header and will already log these in important log lines like query execution. This PR extends blocking functionality to be able to block queries based on these key=value pairs.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@slim-bean slim-bean requested a review from a team as a code owner October 20, 2025 23:29
@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2025

💻 Deploy preview deleted (chore: extend query blocking capabilities).

- pattern: '.*' # optional; if pattern and regex are omittied they will default to '.*' and true
regex: true
tags:
source: grafana
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tags need some explanation. The current examples could be misunderstood to mean that this pattern is a beta feature.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, reading further I see that is exactly what you're doing, blocking queries for a beta feature. Never mind...

Copy link
Contributor

@salvacorts salvacorts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@slim-bean slim-bean merged commit 0207883 into main Oct 24, 2025
72 checks passed
@slim-bean slim-bean deleted the extend-blocking branch October 24, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants