Query prometheus on single metrics using multiple replica due to missing data

Viewed 185

Our Prometheus setup is that we have 1 app metrics that ended up as 2 prometheus metrics with different label prometheus_replica. I believe they are using k8s prometheus operator to set it up.

What I found out there are a lot of missing values randomly between these 2 metrics. Some time same data point are in both metrics replica, and some time only one of them.

example:

replica-0 enter image description here

replica-1 enter image description here

But if I put them together, i see the whole data enter image description here

My question is:

  1. Is this a normal setup or just the infrastructure behind it is just bad?
  2. If This is normal. How would I construct the query. For example if I want to get the sum of a single counter over 5 minutes using both metrics.
  3. I assume that I should be able to use only just one of the replica for my query. is that correct?
0 Answers
Related