Fastly

Stack Monitors

Monitor Fastly CDN with Crowswatch

Monitor real-time CDN analytics, cache performance, and origin health across your Fastly services directly from Crowswatch.

What This Integration Provides

  • Traffic analytics: requests per second, bandwidth, and response code distribution
  • Cache performance: hit rate, miss rate, and cache coverage by service
  • Origin health: origin response times and error rates
  • Error tracking: 4xx and 5xx rates at the edge and at origin
  • Real-time streaming: live metrics via Fastly's real-time stats API

Requirements

RequirementDetail
Fastly accountDeveloper or above
API tokenScoped to global:read
Service IDOne per service you want to monitor
Estimated setup time~5 minutes

Step 1: Generate Credentials

Fastly uses API tokens for authentication.

To create a read-only API token:

  1. Log in to manage.fastly.com
  2. Go to Account → Personal API Tokens
  3. Click Create Token
  4. Enter a name (e.g. crowswatch-monitor)
  5. Set the Scope to global:read, which grants read-only access to stats and configuration
  6. Optionally restrict the token to a specific Service and set an Expiration
  7. Click Create Token
  8. Copy the token, as it is only shown once
Use global:read and not global. The read-only scope is sufficient for all monitoring operations.

Step 2: Locate Required IDs

Service ID

  1. Log in to the Fastly dashboard
  2. Navigate to Deliver → CDN and select your service
  3. The Service ID appears directly below the service name on the overview page
  4. It is also visible in the URL when viewing a service

If you have multiple services, you will need a Service ID for each one you want to monitor.

Step 3: Add Credentials to Crowswatch

Navigate to: Crowswatch → Add Service → Fastly

FieldValue
API TokenThe token generated in Step 1
Service IDThe Service ID from Step 2

To monitor multiple Fastly services, add each one separately in Crowswatch.

Available Metrics

Traffic

  • Total requests per second
  • Bandwidth served (GB)
  • HTTP status code breakdown (2xx, 3xx, 4xx, 5xx)
  • Requests by geographic region

Cache Performance

  • Cache hit rate (%)
  • Cache miss rate (%)
  • Hit-for-pass rate
  • Pass rate

Origin Health

  • Origin fetch count
  • Origin response time (ms)
  • Origin error rate (%)
  • Shield fetches vs origin fetches

Errors

  • Edge 4xx rate
  • Edge 5xx rate
  • Origin 5xx rate
  • Uncacheable response count

Connect

  1. Enter your API Token and Service ID in the Crowswatch form
  2. Click Verify to confirm the credentials are valid
  3. Select the metrics you want to track
  4. Click Connect

Crowswatch will begin polling Fastly's real-time stats API immediately.

Security

  • Use global:read scope. Never use global (full write access) for monitoring
  • Restrict the token to specific services where possible
  • Set an expiration date and rotate tokens periodically
  • Create a dedicated token for Crowswatch rather than sharing with other tools

Troubleshooting

Authentication error

Verify the token is active and has not expired. Confirm the token has global:read scope, as tokens scoped only to purge operations will not work.

No data appearing

Confirm the Service ID is correct. It should be the ID for an active, live service. Some metrics only populate once the service is receiving traffic.

Service ID not found

The Service ID is case-sensitive. Copy it directly from the dashboard rather than typing it manually. Ensure the token was created under an account that has access to the service.

Partial metrics missing

Real-time stats from Fastly have a short delay. Allow a minute or two before investigating. Some metrics (e.g. shield fetches) are only available if Fastly Shielding is configured on your service.