Connecting Two Prometheus to One Mimir Instance #5529
-
We have a Mimir instance, Prometheus and Grafana in a k8s cluster. We can connect (I suppose) another Prometheus to Mimir in a different k8s cluster. In Mimir-Distributor UI, all_user_stats shows both tenant-ids. We can add Mimir data as a data source in Grafana. Here is our struggling point. When we try to run query for Mimir data source in Grafana, we obtain only first Prometheus metrics which is in the same cluster with Mimir. Second Prometheus is "non-queryable". We try to add externalLabels into prometheuses instances but doesn't work. Also mimir-default dasboards does not work (it tries to obtain data from Can you suggest anything? Maybe, we don't using Mimir concept. Configure all external Prometheuses remote_write to single Mimir than all metrics will be stored and available to any query using Mimir. Do you have suggestions? Mimir is installed with Prometheus config: (I can see prometheus:
prometheusSpec:
externalLabels:
cluster_name: kindtest-1
remoteWrite:
- name: centralized-mimir
url: http://mimir-nginx.k8s.local/api/v1/push # Ingress
headers:
X-Scope-OrgID: kindtest-1 Possible duplication: #1656 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
@bulmust, I'm a little unclear what you're trying to achieve. Is this understanding correct?
If so, have you configured the Prometheus instances to remote write with the same If you're using different values, have you configured the Mimir data source in Grafana with both org IDs? Or just one? |
Beta Was this translation helpful? Give feedback.
-
They have different
I think, I miss that part. Do I have to manually (or in Grafana yaml) add all "Grafana -> Connections -> Data sources -> Mimir Datasource -> Custom HTTP Headers" |
Beta Was this translation helpful? Give feedback.
-
Yep, for the Mimir datasource, include them as the tenant ID separated by pipe characters ( |
Beta Was this translation helpful? Give feedback.
-
If you want to connect two Prometheus with same headers, keep X-Scope-OrgID value the same. You can distinguish metrics with external labels in Grafana. First Prometheus instance: prometheus:
prometheusSpec:
externalLabels:
cluster_name: kindtest-1
remoteWrite:
- name: centralized-mimir
url: http://mimir-nginx.k8s.local/api/v1/push # Ingress
headers:
X-Scope-OrgID: test Second Prometheus instance: prometheus:
prometheusSpec:
externalLabels:
cluster_name: kindtest-2
remoteWrite:
- name: centralized-mimir
url: http://mimir-nginx.k8s.local/api/v1/push # Ingress
headers:
X-Scope-OrgID: test |
Beta Was this translation helpful? Give feedback.
Yep, for the Mimir datasource, include them as the tenant ID separated by pipe characters (
|
). For example,kindtest-1|kindtest-2
.