Crates.io | valensas-actuator |
lib.rs | valensas-actuator |
version | 0.4.1 |
source | src |
created_at | 2023-07-12 13:15:47.894067 |
updated_at | 2023-09-22 14:19:52.46036 |
description | A library that provides Prometheus metrics collection capabilities for Rocket applications. |
homepage | |
repository | https://github.com/Valensas/rust-actuator |
max_upload_size | |
id | 914494 |
size | 89,770 |
This library provides facilities for web server lifecycle operations.
Features:
Health checks: liveness and readiness
Diesel health
Customizable indicators
Prometheus metric collection
Rocket http request metrics
Tonic grpc request metrics
r2d2 connection pool metrics
Tokio runtime metrics
Add the following to your Cargo.toml
:
[dependencies]
valensas-actuator = "*"
The following crate features are available to use:
health: includes health check related functionalities
health-tonic: includes tonic-health health indicator
health-diesel: includes diesel health indicator
promtheteus-rocket: includes Prometheus scrap endpoint and Rocket http request metric collection
prometheus-tonic: includes Tonic grpc request metric collection
prometheus-r2d2: includes r2d2 connection pool metrics collection
For detailed usage examples, see the examples directory.
Contains examples on how to configure health check endpoints and custom health indicators.
Run with cargo run --example health --features health,health-diesel
.
Contains examples on how to configure Prometheus scrap endpoint and Rocket request metric collection.
Run with cargo run --example prometheus --features prometheus-rocket
.
Contains examples on how to configure Prometheus scrap endpoint and Tonic gRPC request metric collection.
Run with cargo run --example prometheus_tonic --features prometheus-tonic
.
Contains examples on how to configure the r2d2 connection pool collector to expose pool usage metrics.
Run with cargo run --example prometheus_r2d2 --features prometheus-r2d2
Contains examples on how to configure the Tokio runtime pool collector to expose runtime usage metrics.