script-exporter icon indicating copy to clipboard operation
script-exporter copied to clipboard

Running multiple scripts

Open JayashriKK opened this issue 6 years ago • 1 comments

Hi .. New to Prometheus. Below is my prometheus.yml file.

global: scrape_interval: 15s

scrape_configs:

  • job_name: 'prometheus' scrape_interval: 5s static_configs:
    • targets: ['localhost:9090']
  • job_name: 'script1' metrics_path: /metrics/script1 static_configs:
    • targets: ['localhost:9661']
  • job_name: 'script2' metrics_path: /metrics/script2 static_configs:
    • targets: ['localhost:9661']
  • job_name: 'script-exporter' metrics_path: /metrics static_configs:
    • targets: ['localhost:9661'] Here are the scripts /path/to/my/scripts$ ls -ltr total 8 -rwxrwxrwx 1 root root 117 Jul 12 13:29 script1 -rwxrwxrwx 1 root root 114 Jul 12 15:04 script2 Getting below error.

/etc/script-exporter$ sudo ./script-exporter -script.path /path/to/my/scripts -web.listen-address :9661 2019/07/12 15:39:34 error parsing output from script 'script2': Error parsing Prometheus TextFormat: text format parsing error in line 1: expected float as value, got ""

How to fix this?

JayashriKK avatar Jul 12 '19 19:07 JayashriKK

It sounds like script2 isn't outputting in the correct format, see https://prometheus.io/docs/instrumenting/exposition_formats/

ncabatoff avatar Jul 27 '19 15:07 ncabatoff