| Crates.io | s3-bucket-stats |
| lib.rs | s3-bucket-stats |
| version | 0.8.1 |
| created_at | 2023-07-07 14:08:21.824681+00 |
| updated_at | 2025-05-20 13:13:10.880104+00 |
| description | Prometheus metrics endpoint for S3 bucket stats |
| homepage | https://gitlab.com/CYSO/open-source/s3-bucket-stats |
| repository | https://gitlab.com/CYSO/open-source/s3-bucket-stats |
| max_upload_size | |
| id | 910779 |
| size | 131,365 |
Current version: 0.8.1
Prometheus metrics endpoint for S3 bucket stats.
This tool can be run in either single or serve mode.
In single mode, Prometheus metrics will be generated and output to stdout.
In serve mode, a simple HTTP server will be started at --listen-address and --listen-port
with a single endpoint at /metrics. TLS encryption or any type of authentication is not supported.
Configuration can be done with command line arguments. To pass S3 credentials and configuration, use the common AWS Environment variables. You'll probably at least want to specify:
For a full list of supported AWS variables, see the source of reqsign/services/aws-v4 .
All CLI arguments can also be specified als environment variable. Do note that METRICS_EXTRA_LABELS
is limited to a single value, if multiple values are required then specify --metrics-extra-labels
multiple times. See the output of --help for the available names.
With version 0.8.0 a switch was made to another S3 library, and some AWS environment variable names were changed. In particular:
AWS_ENDPOINT to AWS_ENDPOINT_URL and AWS_DEFAULT_REGION to AWS_REGION. AWS_REGION is now mandatory.
This tool was created to be run as a service in container, for easy scraping using a ServiceMonitor or
PodMonitor. In serve mode there is a single HTTP endpoint at /metrics that will contain all Prometheus
metrics. This endpoint will return a 404 error until the metrics have been loaded for the first time.
For buckets with a large amount of objects this can take several minutes, so take care when using this
endpoint for liveness or readiness checks.
There are four separate endpoints for health probes: /healthz, /healthz/startup, /healthz/liveness
and /healthz/readiness. The first three will return 200 OK as soon as the HTTP daemon is running, and
until the expiration_interval has expired. If the metrics have been marked as stale, a
503 SERVICE UNAVAILABLE will be returned. The readiness endpoint will return 503 SERVICE UNAVAILABLE
until the metrics have been loaded, then it will return 200 OK.
A Helm chart is available in the charts/ subdirectory and in the Gitlab Helm registry.
GPL-3.0-only, see LICENSE file for details.