You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose Bunny.net statistics as a scrapable Prometheus endpoint.
bunnynet_prometheus is a daemon that periodically polls the Bunny.net API for usage and performance statistics and re-exposes it as Prometheus metrics on an HTTP endpoint.
All available statistics endpoints in the Bunny.net API are covered: Magic Containers, DNS zones, Edge scripts, Storage zones, Video libraries, Video transcribing, Video DRM, Pull zones, Pull zone optimizers, Pull zone origin shield queues, Pull zone SafeHops and Shield zones.
Each category of statistics is implemented as a separate collector that can be individually enabled. Details about available collectors and the metrics they emit can be found under Collectors.
Counter values are persisted to disk between poll cycles, so restarts don't reset totals and day rollovers are correctly handled. If the daemon has been stopped for an extended period, missed days will be backfilled. The day rollover follows Bunny.net (UTC). Each collector keeps a state file in the state directory (default ~/.local/share/bunnynet_prometheus/state) which maintains a running tally of totals.
Installation
bunnynet_prometheus can be compiled with cargo or you can download prebuilt releases.
bunnynet_prometheus [OPTIONS] --collectors <COLLECTORS>...
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Only output warnings and errors
-k, --access-key <ACCESS_KEY>
Bunny.net API access key (Can also be set by environment variable BUNNYNET_ACCESS_KEY)
-f, --access-key-file <ACCESS_KEY_FILE>
Path to a file containing a Bunny.net API access key
-r, --api-request-timeout <API_REQUEST_TIMEOUT>
Timeout in seconds for Bunny.net API requests [default: 10]
-n, --api-concurrency <API_CONCURRENCY>
Maximum number of concurrent Bunny.net API requests [default: 5]
-i, --poll-interval <POLL_INTERVAL>
Update interval in seconds [default: 300]
-s, --state-dir <STATE_DIR>
Path to a directory to store persistent state files in [default: ~/.local/share/bunnynet_prometheus/state]
-a, --bind-addr <BIND_ADDR>
HTTP server bind address [default: 0.0.0.0]
-p, --bind-port <BIND_PORT>
HTTP server bind port [default: 9000]
-c, --collectors <COLLECTORS>...
Comma-separated list of categories of statistics to poll [possible values: application, dns_zone, edge_script, storage_zone, video_library, video_library_transcribing, video_library_drm, pull_zone, pull_zone_optimizer, pull_zone_origin_shield_queue, pull_zone_safehop, shield_zone]
-h, --help
Print help
-V, --version
Print version