ricoberger / script_exporter

Prometheus exporter to execute scripts and collect metrics from the output or the exit status.
MIT License
354 stars 82 forks source link

Using scrape config with discovery does not trigger the scripts #69

Closed OranShuster closed 1 year ago

OranShuster commented 1 year ago

Using the following scrape config in prometheus

      - job_name: 'script-exporter-discovery'
        http_sd_configs:
          - url: http://script-exporter-svc:9469/discovery

i can see the script_success and all the rest of the "basic" metrics but the script itself does not get triggered

ricoberger commented 1 year ago

Hi @OranShuster, when the script_success metric is present, it means that the script was executed. Is the script_success metric 1? If the script_success metric is 0 it means that the script execution failed and then the exported metrics from the script are omitted (see #63).

OranShuster commented 1 year ago

it seems my script was indeed not running successfully. i ended up using a scrape config per job and now facing timeout issues although i am using the recommended timeout command i will need to investigate this further