Skip to content

Latest commit

 

History

History
68 lines (48 loc) · 1.43 KB

README.md

File metadata and controls

68 lines (48 loc) · 1.43 KB

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