[🐛 Bug]: Prometheus provider ignores custom fingerprint fields for dedupe
Describe the bug It appears that the Prometheus provider ignores custom fingerprint fields set in the deduplication rule and generates the fingerprint hash based on the alertname alone.
To Reproduce Steps to reproduce the behavior:
- Provision or manually add a Prometheus provider. (with pulling enabled)
- Modify default deduplication rule for Prometheus provider to use multiple labels for Fields to use for fingerprint.
- Observe alerts with different values for selected fingerprint labels are still deduplicated based on alert name alone.
Expected behavior Prometheus provider should generate a unique fingerprint hash based on labels configured in deduplication rule.
Additional context
Provider provision config:
{
"keepPrometheus": {
"type": "prometheus",
"authentication": {
"url": "https://prometheus.dev1.domain.com",
"verify": false
},
"deduplication_rules": {
"prometheus_default_dedupe": {
"description": "This is the default deduplication rule for Prometheus alerts",
"fingerprint_fields": [
"labels.alertname",
"labels.env_dc",
"labels.group"
],
"full_deduplication": false
}
}
}
}
Note identical fingerprint hash for alerts with different group labels:
$ echo -n 'NodeLowDiskSpace4Hours' | sha256sum
6211e97de90695be41b49c773306001204872a6ebb36f4aa72a5bbd998ce7ac5 -
Hi @poandlsl! I'm Dosu and I’m helping the keep team.
This is a confirmed bug: the Prometheus provider currently ignores custom fingerprint fields set in deduplication rules and falls back to using only the alertname for fingerprinting, even when multiple fields are configured. This causes alerts with different label values to be deduplicated as if they were the same alert, matching your observations and config. The root cause is that the provider does not dynamically apply the deduplication rule’s fingerprint_fields when generating fingerprints, despite Keep’s general support for this feature across other providers. There are open issues tracking this limitation, and a fix is planned but not yet merged [issue #4766, docs].
If you need a workaround before a fix lands, you may be able to manually patch the provider logic to use the correct fingerprint fields, as described in the linked issue. Otherwise, keep an eye on the repo for updates.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
I've opened #6242 to fix this. The root cause is that custom dedup rules (fingerprint_fields) are only applied in format_alert() (webhook path) but not in get_alerts() (pull path). When pulling, the native Prometheus fingerprint (based on alertname alone) was used, ignoring user-configured fields.
The fix adds the same get_custom_deduplication_rule + get_alert_fingerprint call to BaseProvider.get_alerts(), so all providers benefit when pulling alerts.
@poandlsl this should fix your issue -- the pull path was missing custom dedup rule application entirely. PR is up at #6242, would appreciate if you could confirm it matches your setup.