A comprehensive, out-of-the-box monitoring and alerting solution for Fastly services.
This repository contains a Docker Compose setup that deploys a full monitoring stack, including: The Fastly Exporter for Prometheus, Prometheus, Alertmanager, and Grafana. It comes pre-loaded with a suite of dashboards and alerting rules, with built-in Slack integration.
- Turnkey Setup: Launch a complete Fastly monitoring stack with a single command
- Comprehensive Dashboards: Visualize real-time and historical metrics with a rich set of pre-built Grafana dashboards
- Extensive Alerting: Over 70 pre-configured Prometheus alerts to proactively monitor service health, performance, and security
- Slack Integration: Receive timely alerts directly in your Slack workspace
- Customizable: Easily extend the dashboards and alerting rules to fit your specific needs
The following Grafana dashboards are provisioned automatically:
- Fastly Dashboard: High-level overview of all Fastly services
- Fastly Service: Detailed view of a single Fastly service
- Fastly Compute: Metrics for your Fastly Compute services
- Fastly Security: Security-related metrics, including WAF and TLS data
- Fastly Thresholds: Monitor against defined thresholds
- Top Services: Summary of your most active services
- Top Datacenters: A breakdown of your traffic by Fastly datacenter
- Top Origins: A summary of your most active origin servers
The stack includes a set of pre-configured Prometheus alerting rules that are sent to Alertmanager and can be routed to Slack. The rules cover the following categories:
- Account
- Cache Performance
- Compute
- Datacenter Health
- Errors
- Latency
- Origin Health
- Security
- Service Health
- Thresholds
- Traffic Volume
You can customize and add your own rules in the prometheus/rules/
directory.
This project uses the following containerized services:
Service | Image | Version |
---|---|---|
Prometheus | prom/prometheus |
v2.53.5 |
Alertmanager | prom/alertmanager |
v0.28.1 |
Grafana | grafana/grafana |
12.1 |
Fastly Exporter | ghcr.io/fastly/fastly-exporter |
v9.5.0 |
Envsubst | bhgedigital/envsubst |
latest |
- Docker and Docker Compose
- A Fastly API Token with
global:read
permissions. - A Slack Incoming Webhook URL for alerts.
-
Clone the repository:
git clone https://github.com/fastly/fastly-dashboards.git cd fastly-dashboards
-
Export the required environment variables:
export FASTLY_API_TOKEN="YOUR_FASTLY_TOKEN" export SLACK_API_URL="YOUR_SLACK_WEBHOOK_URL" export SLACK_CONFIG_CHANNEL="#your-slack-channel"
Use docker compose
(recommended) or docker-compose
to launch the stack:
docker compose up -d
It may take a few minutes for all services to start and for data to be collected.
Once the stack is running, you can access the Grafana dashboards at http://localhost:3000.
Login is disabled, and you will be granted anonymous admin access.
no configuration file provided: not found
This can happen if you are using Docker Snap, which requires that all files Docker needs access to live within your $HOME
folder. Try running the project from a directory inside your home folder.
- Graphs are broken and my system is dying!
Processing Fastly metrics can be resource-intensive, especially with many services. To reduce the load, you can configure the fastly-exporter
to sample a fraction of your services using the FASTLY_EXPORTER_OPTIONS
environment variable.
For example, to process metrics for 1/10th of your services:
export FASTLY_EXPORTER_OPTIONS="-service-shard 1/10"
docker compose up
- No Slack Alerts
If you see an error like channel \"#NO_SLACK_CONFIG_CHANNEL\": unexpected status code 404: 404 page not found
, it means your Slack integration is not configured correctly.
Ensure that the $SLACK_API_URL
and $SLACK_CONFIG_CHANNEL
environment variables are exported correctly before starting the stack.
If you already have an existing monitoring stack, you can integrate the configurations from this repository.
- Scrape Configuration: Add the
fastly-exporter
job to yourprometheus.yml
:
- job_name: "fastly-exporter"
static_configs:
- targets: ["fastly-exporter:8080"]
Ensure the fastly-exporter
container is reachable by your Prometheus instance.
- Alerting Rules: Copy the rule files from the
prometheus/rules/
directory to your Prometheus rules directory and update yourprometheus.yml
to load them:
rule_files:
- "/path/to/your/rules/*.yml"
-
Configuration: Add the
slack-notifications
receiver fromalertmanager/alertmanager.yml
to your Alertmanager configuration. You will also need to add the corresponding route. -
Templates: Copy the template files from
alertmanager/templates/
to your Alertmanager templates directory.
-
Dashboards: Copy the dashboard JSON files from the
grafana/provisioning/dashboards/
directory to your Grafana dashboards directory. -
Provisioning: Configure Grafana to provision the dashboards. You can use the
grafana/provisioning/dashboards/dashboard.yml
as a reference. -
Datasource: Ensure you have a Prometheus datasource configured in Grafana.
These official dashboards were inspired by the original fastly-dashboards project by @mrnetops. Their work was featured in the Magic tricks with Docker (or how to monitor Fastly in about five minutes) presentation at the Fastly Altitude conference in 2020.