Skip to content

Commit 405265e

Browse files
authored
Merge pull request #162 from posit-dev/fix-alloy-blackbox-instances
fix: alloy instance duplication bug
2 parents 59b5a62 + ab2e645 commit 405265e

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

python-pulumi/src/ptd/pulumi_resources/grafana_alloy.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,27 @@ def _define_config_map(
493493
494494
prometheus.scrape "blackbox" {{
495495
targets = prometheus.exporter.blackbox.front_door.targets
496-
forward_to = [prometheus.relabel.default.receiver]
496+
forward_to = [prometheus.relabel.blackbox.receiver]
497497
clustering {{
498498
enabled = true
499499
}}
500500
}}
501501
502+
// Normalize instance label for blackbox metrics to deduplicate across Alloy pods.
503+
// Each pod runs its own blackbox exporter, producing metrics with different
504+
// instance labels (node hostnames). Replacing instance with a static value
505+
// ensures Mimir deduplicates them, preventing duplicate alerts.
506+
// See: https://github.com/grafana/alloy/issues/1009
507+
prometheus.relabel "blackbox" {{
508+
forward_to = [prometheus.relabel.default.receiver]
509+
510+
rule {{
511+
action = "replace"
512+
target_label = "instance"
513+
replacement = "blackbox"
514+
}}
515+
}}
516+
502517
prometheus.scrape "pods" {{
503518
targets = discovery.relabel.pod_metrics.output
504519
forward_to = [prometheus.relabel.default.receiver]

0 commit comments

Comments
 (0)