Prometheus exporter to invoke scripts and parse their output as metrics.
  • Go 94%
  • Makefile 4%
  • Dockerfile 2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2019-07-27 12:22:12 -04:00
.circleci Switch from dep to go modules and from travis to circleci. 2019-07-27 12:22:12 -04:00
vendor Switch from dep to go modules and from travis to circleci. 2019-07-27 12:22:12 -04:00
.gitignore Switch from dep to go modules and from travis to circleci. 2019-07-27 12:22:12 -04:00
.goreleaser.yml Try to tag docker image with :latest as well as version tag. 2018-05-13 18:26:15 -04:00
base_test.go Initial commit. 2017-05-18 22:07:10 -04:00
command.go Fix potential goroutine leaks reported by go vet. 2018-05-13 17:48:40 -04:00
command_test.go Initial commit. 2017-05-18 22:07:10 -04:00
Dockerfile Move to go 1.10. Use the makefile when building in docker. 2018-08-19 14:20:30 -04:00
Dockerfile.goreleaser Add Makefile, goreleaser, travis. 2018-05-13 17:54:40 -04:00
go.mod Switch from dep to go modules and from travis to circleci. 2019-07-27 12:22:12 -04:00
go.sum Switch from dep to go modules and from travis to circleci. 2019-07-27 12:22:12 -04:00
LICENSE Initial commit 2017-05-18 22:05:00 -04:00
main.go Fix goroutine leaks by calling cancel(). Fix classic goroutine mistake where iteration variable was captured. 2018-05-08 17:04:40 -04:00
Makefile Add Makefile, goreleaser, travis. 2018-05-13 17:54:40 -04:00
metrics.go Initial commit. 2017-05-18 22:07:10 -04:00
metrics_test.go Fix potential goroutine leaks reported by go vet. 2018-05-13 17:48:40 -04:00
README.md Update README.md 2018-05-13 18:36:25 -04:00

script-exporter

Prometheus exporter to invoke scripts and parse their output as metrics.

Release Build Status Powered By: GoReleaser

Usage

script-exporter -script.path /path/to/my/scripts -web.listen-address :9661

Create e.g. /path/to/my/scripts/script1, an executable which emits on stdout metrics in the Prometheus text exposision format.

Then configure your prometheus.yml to add a target like

  - job_name: 'script1'
    metrics_path: /metrics/script1
    static_configs:
      - targets: ['localhost:9661']

If you add another script, you'll need another job, because the metrics path will be different.

You also want to add a job for the script_exporter internal metrics (errors, process stats, etc) as the above job will only yield metrics emitted by script1 itself:

  - job_name: 'script-exporter'
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:9661']

Docker

Build the image running: docker build . Or just run

docker pull ncabatoff/script-exporter