Repository navigation
Metrics
S3Proxy can expose request metrics in the Prometheus text format. Enable the endpoint with:
s3proxy.metrics.enabled=true
Metrics are then served at /metrics on the S3 endpoint itself:
$ curl http://127.0.0.1:8080/metrics
To serve them on a port of their own, which also removes /metrics from the S3 endpoint:
s3proxy.metrics.enabled=true
s3proxy.metrics.port=9090
s3proxy.metrics.host=127.0.0.1
s3proxy.metrics.host defaults to the S3 endpoint's host and is read only when a port is set.
The Docker image reads S3PROXY_METRICS_ENABLED, S3PROXY_METRICS_PORT and S3PROXY_METRICS_HOST. It defaults the port to 9090 and the host to 0.0.0.0, so setting S3PROXY_METRICS_ENABLED=true serves metrics on port 9090 of the container.
One histogram, http_server_request_duration_seconds, records every request. Its count and sum give request rates and mean latency, and its buckets give percentiles. The labels are:
| label | example |
|---|---|
s3_operation |
GetObject, PutObject, ListBuckets
|
s3_bucket |
the bucket named by the request, absent for ListBuckets
|
http_request_method |
GET |
http_response_status_code |
200 |
url_scheme |
http |
http_server_request_duration_seconds_count{http_request_method="GET",http_response_status_code="200",otel_scope_name="org.gaul.s3proxy",s3_bucket="bucket",s3_operation="GetObject",url_scheme="http"} 1
http_server_request_duration_seconds_sum{http_request_method="GET",http_response_status_code="200",otel_scope_name="org.gaul.s3proxy",s3_bucket="bucket",s3_operation="GetObject",url_scheme="http"} 0.022843027
The metrics endpoint is not covered by s3proxy.authorization: it answers unsigned requests even when the S3 endpoint requires signatures, and its labels name buckets. On a listener that untrusted clients can reach, serve metrics on a dedicated port bound to an internal address.