Prometheus Pushgateway-无法推送样品请求

时间:2019-07-14 12:39:27

标签: prometheus metrics

我试图了解如何将指标发送到 Prometheus Pushgateway 。我正在使用here

中的示例

第一个curl发布查询

echo "some_metric 3.14" | curl --data-binary @- https://mypushgateway/metrics/job/some_job

工作正常。在prometheus网关度量标准的UI中,我看到以下内容:

some_metric{instance="",job="some_job"} 3.14
push_time_seconds{instance="",job="some_job"} 1.563104072695498e+09

但是当我尝试推送第二个样本

cat <<EOF | curl --data-binary @- http://mypushgateway/metrics/job/some_job/instance/some_instance
# TYPE some_metric counter
some_metric{label="val1"} 42
# TYPE another_metric gauge
# HELP another_metric Just an example.
another_metric 2398.283
EOF

我在指标UI中收到此错误

3 error(s) occurred:
* collected metric "some_metric" { label:<name:"instance" value:"test_instance" > label:<name:"job" value:"some_job2" > untyped:<value:3.15 > } is not a COUNTER
* collected metric "some_metric" { label:<name:"instance" value:"" > label:<name:"job" value:"some_job2" > untyped:<value:3.14 > } is not a COUNTER
* collected metric "another_metric" { label:<name:"instance" value:"some_instancesome_metriclabel=val1" > label:<name:"job" value:"some_job" > untyped:<value:2398.283 > } is not a GAUGE

我在做什么错了?

0 个答案:

没有答案