Label value Coverage issues #588
-
Firstcat <<EOF | curl -X POST --data-binary @- http://127.0.0.1:9091/metrics/job/memory Secondcat <<EOF | curl -X PUT --data-binary @- http://127.0.0.1:9091/metrics/job/memory Why does the second of these two examples overwrite the first? How can they coexist? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As per the documentation, the PUT method always replaces all metrics in the same group, while the POST method only replaces metrics with the same name (AKA the metric family). In your example, you are always pushing to the same group ( If you want to push both of them in different pushes, and you want both of them to co-exist on the PGW, you have to push them into different groups. In your case, you could make the |
Beta Was this translation helpful? Give feedback.
As per the documentation, the PUT method always replaces all metrics in the same group, while the POST method only replaces metrics with the same name (AKA the metric family).
In your example, you are always pushing to the same group (
job/memory
), or in PromQL syntax{job="memory"}
. Also, you only push a metric namedmemory
(note that this is the metric name and has nothing to do with thejob
label valuememory
given in the grouping key). So in either case, you will replace the previously pushed metrics.If you want to push both of them in different pushes, and you want both of them to co-exist on the PGW, you have to push them into different groups. In your case, you could make the
code
…