Prometheus Metrics¶
FluxSend can expose Prometheus metrics on a dedicated HTTP listener. The listener is disabled by default and is not mounted on the public API router.
What is exposed¶
The metrics endpoint exports:
- request volume, latency, in-flight requests, response size, and panic counts for the API, CLI API, and admin server
- Go runtime and process metrics from the standard Prometheus collectors
- build metadata through
fluxsend_build_info - storage, email, database health, and database error metrics
- business counters for uploads, shares, downloads, workspaces, invites, members, API keys, auth, and quota rejections
- cached DB-derived gauges for users, plans, files, storage, workspaces, shares, and active API keys
Configuration¶
Use either YAML config or environment variables.
Environment variables:
METRICS_ENABLEDMETRICS_LISTEN_PORTMETRICS_BIND_ADDRESSMETRICS_PATH
Defaults:
enabled=falselisten_port=9464bind_address=""which means all interfacespath=/metrics
The same listener is available in both the normal backend mode and ./fluxsend --dev-api mode when metrics are enabled.
Local scrape¶
Example local startup:
METRICS_ENABLED=true \
METRICS_BIND_ADDRESS=127.0.0.1 \
METRICS_LISTEN_PORT=9464 \
./fluxsend --config ./config.yaml
Scrape it directly:
Prometheus scrape config¶
scrape_configs:
- job_name: fluxsend
metrics_path: /metrics
static_configs:
- targets:
- 127.0.0.1:9464
Security considerations¶
- The endpoint is unauthenticated by design.
- The default bind address is all interfaces, which is convenient for containers but broad for bare-metal hosts.
- Prefer
127.0.0.1, a private interface, a service mesh, or host firewall rules unless Prometheus scrapes over an isolated network. - Do not publish the metrics listener on the public internet.
Example PromQL¶
Request rate by route and status code:
P95 request latency by route:
histogram_quantile(
0.95,
sum by (le, route) (
rate(fluxsend_http_request_duration_seconds_bucket[5m])
)
)
Quota rejections by limit:
Download volume by channel and mechanism:
Database availability:
Active keys by domain: