Skip to content

Yet another Prometheus exporter for the fastly realtime reporting API

License

Notifications You must be signed in to change notification settings

dvhh/fastly-prometheus-exporter

Repository files navigation

fastly-prometheus-exporter

Consume the Fastly Real-time Analytics API and export data via a Prometheus metrics endpoint.

Requirements

Optionals

Usage

FASTLY_API_KEY="${fastly_api_token}" bash loop.sh

Will start endpoint.py to serve the metrics files, and make a loop calling collect_rt_metrics.py which download the metrics and will format the output to be suitable with Prometheus.

Exported metrics

See metrics_list.txt

metrics names are prefixed with fastly_ and are exported as counter

Contributing

Contributions are subjected to reviews, please submit a pull request.

Verify your submission with:

  • shellcheck
  • flake8
  • pylint (in case of conflict flake8 take precedence)

check formatter output with

promtool check metrics < output

TODO

Configurables:

  • Endpoint port (currently only port 5000)
  • loop pause

Improvement

  • Better control of loop length (exact requested time, instead of execution time + sleep)
  • use temp file name and storage
  • logging

About

Yet another Prometheus exporter for the fastly realtime reporting API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published