Prometheus exporter for SONiC NOS.
Currently supported collectors:
- HW collector: collects metrics about PSU and Fan operation
- Interface collector: collect metrics about interface operation and performance.
- CRM collector: collects Critial Resource Monitoring metrics.
- Queue collector: collects metrics about queues.
- Run binary
$ ./sonic-exporter- You can verify that exporter is running by cURLing the
/metricsendpoint.
$ curl localhost:9101/metricsEnvironment variables:
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 ./...