fix(promtail): move monitoring drop from relabel to pipeline_stages

relabel drop removed the entire stream before labels were set, causing
the "at least one label pair required" error. pipeline_stages drop runs
after labels are established, which is correct for filtering by tier.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-30 19:50:04 +02:00
parent aa26ae12ad
commit 5fc34dafe8

View file

@ -82,12 +82,11 @@ scrape_configs:
target_label: "tier"
replacement: "other"
# Drop monitoring container logs to save space (they're noisy)
- source_labels: ["tier"]
regex: "monitoring"
action: drop
pipeline_stages:
# Drop monitoring container logs to save space (they're noisy)
- match:
selector: '{tier="monitoring"}'
action: drop
# Try to parse JSON logs (Go services, Hono services)
- json:
expressions: