thanos icon indicating copy to clipboard operation
thanos copied to clipboard

External labels not applied to alerts

Open lennartack opened this issue 9 months ago • 4 comments

I have configured Prometheus with external_labels. If I understand correctly the Thanos sidecar should add these labels to metrics and rules when they are proxied to the querier. This works on my setup for metrics. However, it seems external labels are not applied to alerts. The /api/v1/alerts endpoint on the Thanos querier gives the alerts without external labels.

lennartack avatar May 02 '24 15:05 lennartack

Thanos Query also deduplicates alerts so I think that's why you don't see them. Are they visible if you removed replica labels from Query?

GiedriusS avatar May 03 '24 10:05 GiedriusS

@GiedriusS The only replica label I have configured is replica. The external label I'm looking for is called cluster. I don't think it is deduplication as the cluster label is applied to metrics, just not to alert instances.

lennartack avatar May 03 '24 11:05 lennartack

I can also see the labels in the alert definitions at /api/v1/rules?type=alert. But not the instances at /api/v1/alerts. The latter is quite important for us for viewing alert instances in Grafana per cluster.

lennartack avatar May 03 '24 11:05 lennartack

:+1: +1 on it, we have same problem.

viktordaniel avatar Oct 01 '24 05:10 viktordaniel