-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External Labels Overwrite existing Labels in Thanos #1579
Comments
Maybe try playing with the dedup labels in the querier. https://github.com/thanos-io/thanos/blob/master/docs/components/query.md#deduplication |
Hi, perhaps you need to specify |
Thanks, but it doesn't change anything. And i don't have duplicate data in the Prometheus instances. These are not redundant prometheus instances. |
same problem, looks like the ingesting prometheus instance wins and overwrites the external label(s) already set in the prometheus instances being scraped from the federation endpoint.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This problem is a bit annoying, hopefully it can be fixed. |
This issue/PR has been automatically marked as stale because it has not had recent activity. Please comment on status otherwise the issue will be closed in a week. Thank you for your contributions. |
Hi 👋 - has anyone found a fix for this? |
Hello, A federated Prometheus instance scrapes local Kubernetes pods and sets the external label When querying that instance directly, we can find the metrics using the label According to Prometheus Documentation this should not happen:
In other words, external labels should only be added to a metric if they do not already exist, or not? |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
in my opinion still an issue |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
This is still an issue in 0.31.0 and the 0.32rc -- thanos sidecar seems to always "apply" |
Yes, this is by design and I don't think there's anything to do here. Otherwise, the deduplication cannot work correctly. Please see: #6564, #6257 (comment). |
Thank your for the quick reply! I'm still a bit confused however, this seems a valid use case. This is a rather annoying problem in some situations and I think there's no easy workaround, unfortunately. |
Can you change your external labels to not have conflicts with series labels? |
Unfortunately, no. These external labels are used as selectors. In our case it happens with a setup like this: external_labels:
cluster: A
replica: 1
scrape_configs:
- job_name: 'a-single-job-for-some-other-cluster'
static_configs:
- targets: ['target:9100']
labels:
cluster: B
... a bunch of scrape jobs for targets in our cluster (A). As this Prometheus only has (literally) one job scraping another "cluster" (using the term lightly here), this seems like the perfect solution. And indeed, querying metrics on the Prometheus itself yields the correct |
Hi,
i’m using a prometheus federation installation which scrapes the data from 3 Prometheus instances. (Don't ask why, this is at the moment necessary)
External Labels are:
Prometheus Federate:
app=„federate“
env=„prod“
Prometheus 1
app=„abc“
env=„dev“
Prometheus 2
app=„abc“
env=„test“
Prometheus 3
app=„abc“
env=„prod“
In the Prometheus Federation my queries locks fine:
for example on Prometheus (Federate) the query
mymetric{env=„prod“}
returns the correct metric
mymetric{app=„ abc“,env=„prod“} = 0
But on Thanos Query Gateway the Announced LabelSets of the Prometheus Federate is app=„federate“ and env=„prod“.
In it seems to overwrite the existing Labels in the metrics
So if i do the same query:
mymetric{env=„prod“}
i now get 3 metrics, all with the same labels:
mymetric{app=„federate“,env=„prod“} = 0
mymetric{app=„federate“,env=„prod“} = 0
mymetric{app=„federate“,env=„prod“} = 0
It seems Thanos „overwrites“ the existing Labels with the accounced ones.
I don't know if this is a bug, or i have done something wrong.
Perhaps you can help
(Note, at the moment i have to scrape a prometheus federation installation and can not change to prometheus with thanos sidecar installed)
Thanks in advance
The text was updated successfully, but these errors were encountered: