N
N
Nikolay Baranenko2017-12-19 01:00:14
Monitoring
Nikolay Baranenko, 2017-12-19 01:00:14

Why are there no new metrics in Prometheus?

Hello.
developed an application in python - a web server that, when accessed by port and URL, returns metric values ​​​​in this form

Some_Metrics{host="server01", key_="system.cpu.util.usage"} 3
Some_Metrics{host="server01", key_="vfs.fs.size[/data,free]"} 7016763392
Some_Metrics{host="server01", key_="system.uname"} Linux server01 4.1.12-94.3.9.el7uek.x86_64 #2 SMP Fri Jul 24 03:09:40 PDT 2017 x86_64
Some_Metrics{host="server02", key_="system.cpu.util.usage"} 2
Some_Metrics{host="server02", key_="vfs.fs.size[/data,free]"} 6016763392
Some_Metrics{host="server02", key_="system.uname"} Linux server02 4.1.12-94.3.9.el7uek.x86_64 #2 SMP Fri Jul 24 01:09:40 PDT 2017 x86_64

registered in the Prometheus config
job_name: some_metrics 
metrics_path: /metrics 
static_configs:
targets: ['server01:8001'] 
params: 
collect[]:
textfile

restarted Prometheus, judging by the application logs, Prommetheus connected and the process started
Tried to write several queries to try to get the values ​​of new metrics,
http://server01:9090/api/v1/query_range?query={host=%22server01%22}&start=1513629658.0&end=1513633258.0&step=60


http://server01:9090/api/v1/query_range?query=some_metrics&start=1513629658.0&end=1513633258.0&step=60

Nothing in return
{"status":"success","data":{"resultType":"matrix","result":[]}}

What am I doing wrong and how to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2018-06-10
@2ord

In my opinion, the format of the metrics is not respected. Values ​​can only be of real type and certainly not of string type.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question