sinkingpoint / prometheus-gravel-gateway

A Prometheus Aggregation Gateway for FAAS applications
GNU Lesser General Public License v3.0
115 stars 10 forks source link

URL label values are being swapped #24

Closed antoinedeschenes closed 1 year ago

antoinedeschenes commented 1 year ago

If I specify more than one label in the push URL, it looks like values get swapped randomly:

Here's a script to replicate the issue:

#!/bin/bash

for i in {1..10}; do
  cat <<EOF | curl --data-binary @- localhost:4278/metrics/namespace/foo/label2/bar/
# TYPE test_total counter
test_total 1
EOF
done

curl localhost:4278/metrics

It outputs the following, while I'd expect no {namespace="bar",label2="foo"} metric:

# TYPE test_total counter
test_total{namespace="foo",label2="bar"} 5
test_total{namespace="bar",label2="foo"} 5
sinkingpoint commented 1 year ago

Pulled this in to 1.6.2