Prometheus exporter for SONiC NOS.
Currently supported collectors, all enabled by default:
| Collector | Flag | Description |
|---|---|---|
| Interface | --collector.interface |
Metrics about interface operation and performance. |
| HW | --collector.hw |
Metrics about PSU and Fan operation. |
| CRM | --collector.crm |
Critical Resource Monitoring metrics. |
| Queue | --collector.queue |
Metrics about queues. |
- Run binary
$ ./sonic-exporter- You can verify that exporter is running by cURLing the
/metricsendpoint.
$ curl localhost:9101/metricsEvery collector is enabled by default. To disable one, pass its flag with the
--no- prefix:
$ ./sonic-exporter --no-collector.queue --no-collector.crmRun ./sonic-exporter --help for the full list of flags.
REDIS_ADDRESS- redis connection string, if using unix socket setREDIS_NETWORKtounix. Default:localhost:6379.REDIS_PASSWORD- password used when connecting to redis.REDIS_NETWORK- redis network type, either tcp or unix. Default:tcp.
- Development environment is based on docker-compose. To start it run:
$ docker-compose up --build -d- To verify that development environment is ready try cURLing the
/metricsendpoint, you should see exported metrics.:
$ curl localhost:9101/metrics- After making code changes rebuild docker container:
$ docker-compose down
$ docker-compose up --build -dIn case you need to add additional keys to redis database don't forget to run SAVE in redis after doing so:
$ redis-cli
$ 127.0.0.1:6379> SAVECurrently, tests are using mockredis database which is populated from fixture files. To run tests manually simply execute:
$ go test -v ./...