Answer the question
In order to leave comments, you need to log in
Checking target on promtool returns "error while linting: text format parsing error in line 1: invalid metric name"?
Hello.
Wrote a python application that, by API request http://server01:8001/metrics
, returns both in print(stdout)
and in
def do_GET(s):
s.wfile.write(output.encode())
# Found hosts: 2
some_metrics{hostname="sever01", key_="system.cpu.util.usage"} 4
some_metrics{hostname="server01", key_="vfs.fs.size[/data,free]"} 180073318400
some_metrics{hostname="server02", key_="system.cpu.util.usage"} 0
some_metrics{hostname="server02", key_="vfs.fs.size[/data,free]"} 597773049856
- job_name: some_metrics
metrics_path: /metrics
static_configs:
- targets: ['server01:8001']
curl -s http://server01:8001/metrics | /data/prometheus/promtool check metrics
error while linting: text format parsing error in line 1: invalid metric
Answer the question
In order to leave comments, you need to log in
Try going to the Status -> Targets section in the prometheus web interface . And there may be an additional error for your endpoint.
In my case, it was that it was not authorized (server returned HTTP status 401 Unauthorized)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question