Crates.io | sozu-prometheus-connector |
lib.rs | sozu-prometheus-connector |
version | 1.1.0-rc.0 |
source | src |
created_at | 2024-07-19 08:42:33.815451 |
updated_at | 2024-10-21 14:17:59.476777 |
description | This application retrieve internals metrics of Sōzu and format them into prometheus |
homepage | https://github.com/CleverCloud/sozu-prometheus-connector |
repository | |
max_upload_size | |
id | 1308421 |
size | 140,535 |
Receives HTTP GET requests on a /metrics
route, forwards the request to Sōzu,
packages the responses in a Prometheus format and sends them back in a HTTP response.
In the config.toml
of this repository,
you have to indicate the absolute path to the configuration file
of the Sōzu that runs on the machine.
sozu_configuration_path = "/path/to/sozu/on/the/machine/config.toml"
The Sōzu config file will be parsed to find to unix socket on which to write requests to Sōzu.
You will have to provide a socket address on which the prometheus connector will
wait for HTTP requests on the /metrics
path.
# address on which to listen. Must be parsable to the SocketAddr type
listening_address = "0.0.0.0:3000"
you can also chose to flatten all metric and to compound them if they have the same name, turning thig:
# TYPE bytes_out counter
bytes_out{worker="0"} 246
bytes_out{cluster_id="MyCluster",backend_id="the-backend-to-my-app"} 250
bytes_out{cluster_id="MyCluster",backend_id="the-backend-to-my-app-2"} 250
bytes_out{worker="1"} 246
bytes_out{cluster_id="MyCluster",backend_id="the-backend-to-my-app"} 250
bytes_out{cluster_id="MyCluster",backend_id="the-backend-to-my-app-2"} 250
into this:
# TYPE bytes_out counter
bytes_out{} 492
bytes_out{cluster_id="MyCluster"} 1000
You can do this with:
aggregate-backend-metrics = true
sozu-prometheus-connector
with cargo run -- --config config.toml
127.0.0.1:3000
The prometheus-formatted metrics should appear in the browser.