salt-run state.event pretty=True
under steroids
Salt Exporter comes with Salt Live
. This is a Terminal UI tool to watch events in real time.
Salt Exporter
is a Prometheus exporter for Saltstack events. It exposes relevant metrics regarding jobs and results.
This exporter is passive. It does not use the Salt API.
It works out of the box: you just need to run the exporter on the same user as the Salt Master.
$ ./salt-exporter
$ curl -s 127.0.0.1:2112/metrics
salt_expected_responses_total{function="cmd.run", state=""} 6
salt_expected_responses_total{function="state.sls",state="test"} 1
salt_function_responses_total{function="cmd.run",state="",success="true"} 6
salt_function_responses_total{function="state.sls",state="test",success="true"} 1
salt_function_status{minion="node1",function="state.highstate",state="highstate"} 1
salt_new_job_total{function="cmd.run",state="",success="false"} 3
salt_new_job_total{function="state.sls",state="test",success="false"} 1
salt_responses_total{minion="local",success="true"} 6
salt_responses_total{minion="node1",success="true"} 6
salt_scheduled_job_return_total{function="state.sls",minion="local",state="test",success="true"} 2
salt_health_last_heartbeat{minion="local"} 1703053536
salt_health_last_heartbeat{minion="node1"} 1703053536
salt_health_minions_total{} 2
-health-minions
, health-functions-filter
and health-states-filter
are deprecated.
They should be replaced by metrics configuration in the config.yml
file.
The equivalent of ./salt-exporter -health-minions -health-functions-filter "func1,func2" -health-states-filter "state1,state2"
is:
metrics:
salt_responses_total:
enabled: true
salt_function_status:
enabled: true
filters:
functions:
- "func1"
- "func2"
states:
- "state1"
- "state2"
Just use the binary from Github releases page.
Or, install from source:
go install github.com/kpetremann/salt-exporter/cmd/salt-exporter@latest
go install github.com/kpetremann/salt-exporter/cmd/salt-exporter@main
Simply run:
./salt-exporter
The exporter can be configured in different ways, with the following precedence order:
See the official documentation for more details