Crates.io | cinc_server_exporter |
lib.rs | cinc_server_exporter |
version | 0.1.5 |
source | src |
created_at | 2023-05-15 17:12:51.740055 |
updated_at | 2023-05-23 12:49:40.776893 |
description | A prometheus exporter for CINC Server and CINC compatible configuration management solutions. |
homepage | |
repository | https://github.com/esoterick/cinc_server_exporter |
max_upload_size | |
id | 865229 |
size | 62,866 |
A prometheus exporter for CINC Server and CINC compatible configuration management solutions.
Explore the docs »
Report Bug
·
Request Feature
While working at my current gig I found we were lacking some metrics to gain a deeper visibility in to our infrastructure. I built this exporter to fill some of those gaps.
This project assumes you have cinc-server installed with the default database settings.
sudo su - opscode-pgsql
wget # automated builds/releases coming soon
./cinc_server_exporter
curl http://localhost:9165/metrics
Pull latest code
git clone https://github.com/esoterick/cinc_server_exporter.git
Enter project directory
cd cinc_server_exporter
Allow direnv and let nix to do it's thing
devenv init
Update .envrc with any configuration options, most importantly the host= string should be set to the current working directory of the repo plus .devenv/state/postgres
which is the default location of where devenv stores the test postgres instance data.
export CINC_SERVER_EXPORTER_CONN_STRING="host=$(pwd)/.devenv/state/postgres user=rlambert dbname=opscode_chef"
export CINC_SERVER_EXPORTER_INTERVAL="15"
Allow updated direnv
direnv allow .
Run test database
devenv up
Import Test Data
createdb opscode_chef
psql -U rlambert -d opscode_chef -f test/data/nodes.sql
Run exporter
cargo run
Scrape
curl http://localhost:9165/metrics
There are a handful of options to configure the exporter which is done via the following environment variables.
CINC_SERVER_EXPORTER_CONN_STRING
- Postgres connection string to the CINC database. default: host=localhost user=opscode-pgsql dbname=opscode_chef
CINC_SERVER_EXPORTER_INTERVAL
- Interval to scrape the database in seconds. default: 15
CINC_SERVER_EXPORTER_LISTEN_ADDR
- Listen address for the exporter. default: 0.0.0.0
CINC_SERVER_EXPORTER_LISTEN_PORT
- Listen TCP port for the exporter. default: 9164
Current list of available exported metrics
Exporter Level
cinc_server_exporter_last_updated
- THe UNIX timestamp of the last cache update for the cinc_server_exporterServer Level
cinc_server_node_count
- The count of all the nodes stored on the cinc_serverNode Level
cinc_server_node_last_updated
- Per node, the UNIX timestamp of the last node updateAxum
axum_http_requests_duration_seconds_bucket
axum_http_requests_duration_seconds_count
axum_http_requests_duration_seconds_sum
axum_http_requests_pending
axum_http_requests_total
See the open issues for a full list of proposed features (and known issues).
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Robert J. Lambert III - robert.j.lambert@pm.me Project Link: https://github.com/esoterick/cinc_server_exporter