Skip to main content

View CDN statistics in Grafana

CDN delivery traffic, cache efficiency, and request counts can be shown as Grafana time-series panels. The Grafana plugin adds the CDB Platform-EN data source.

The previous CDN-only plugin (cdn-stats) is deprecated. Migrate existing dashboards to CDB Platform-EN.

Configure a dashboard

The panel uses the connected CDB Platform-EN data source.

  1. In the top bar, click +, then New dashboard.
Plus menu open on New dashboard
  1. The Add drawer opens on the right. Click Panel.
Add drawer with the Panel control
  1. Click Edit visualization.

  2. Under Data source, select CDB Platform-EN.

  3. Under Edge Network, set Service to CDN.

  4. Under Query Props, set Metric, Granularity, and Group By. Filters under Filters (comma separated) are optional.

  5. Click Save. In Save dashboard, enter a title and click Save.

The saved dashboard shows the title and the panel.

Saved dashboard with the Total Requests panel

Query fields

CDN queries cover delivery traffic, cache efficiency, and request or response trends. The metric values match the CDN statistics API. An alert rule on one of these queries changes state when a value crosses a threshold.

Metrics

Menu labelMetricDescription
BandwidthbandwidthMaximum transfer rate during the selected time, in bytes per second
Total Traffictotal_bytesTotal traffic volume: origin to CDN or Shielding, Shielding to CDN, and CDN to users
Origin Trafficupstream_bytesOrigin traffic: origin to CDN or origin to Shielding
Edges Trafficsent_bytesEdges traffic: Shielding to CDN plus CDN to users
Shield Trafficshield_bytesTraffic from Shielding to CDN
Total RequestsrequestsNumber of requests to the CDN
2xx Responsesresponses_2xxResponse count for the 2xx status class
3xx Responsesresponses_3xxResponse count for the 3xx status class
4xx Responsesresponses_4xxResponse count for the 4xx status class
5xx Responsesresponses_5xxResponse count for the 5xx status class
Image optimizationimage_processedNumber of processed images
Cache Hit Ratiocache_hit_requests_ratioShare of responses served from cache
Byte Cache Hit Ratiocache_hit_traffic_ratioShare of cached traffic: 1 - (origin or Shielding traffic / CDN-to-user traffic)
Shield Traffic Ratioshield_traffic_ratioShielding efficiency: (Shielding-to-CDN traffic - origin-to-Shielding traffic) / Shielding-to-CDN traffic

Granularity: 5m, 15m, 1h, or 1d.

Group By: Resource, Client, Vhost (custom domain), Region, Country, or Datacenter. More than one value can be selected. The query sends resource, client, vhost, region, country, or dc.

Filters (comma separated): optional Vhosts, Resources, Clients, Regions, and Countries fields narrow the series. Separate several values with commas.

Legend Format: the default legend includes the metric name and the group-by values. A custom template uses placeholders in double curly braces that match the grouping: Traffic ({{resource}}).

Total Requests, granularity 5m, and Group By set to Resource produce one series per CDN resource:

CDN requests grouped by resource

Dashboard variables

Dashboard variables can drive CDN filters so the same panel switches between resources, clients, or other dimensions without editing the query.

  1. On the dashboard, click Add variable, then Query.

  2. Set Name to the name used in the filter. resource matches the Resources filter.

  3. Under Query options, click Open variable editor. Select CDB Platform-EN, then set Values for to resourceID, vhost, client, country, or region.

  4. Sort, Multi-value, and Include All value are optional.

  5. Click Apply. In the matching CDN filter, enter the variable with a $ prefix. $resource goes in Resources.

  6. Save the dashboard.