With the Gcore cdn-stats plugin in Grafana, you can display the CDN statistics by:
You can group metrics by the following parameters:
Note: The plugin is designed for Grafana version 7.0 and higher.
To configure CDN statistics in Grafana, you need to:
Video instructions of the steps:
Download the gcore-cdn-stats-datasource-1.0.8.zip file with the latest version of the plugin in GitHub.
Note: The numbers (1.0.8) in the file name indicate the plugin version and may differ depending on updates.
Unzip the archive to the Grafana plugin folder. By default, this is the Grafana\grafana\data\plugins installation folder.
Restart and log in to Grafana.
Click the gear icon in the menu to open the "Configuration" section, select "Data Sources".
Click Add data source to add a new resource for getting data.
Find the cdn-stats plugin from Gcore and click "Select".
The plugin settings will be opened. Add a permanent API token to the "Auth" section.
You can get a token in your personal account. To do this, go to Profile > API tokens > Create.
Insert the received API token in the API token field in the format: APIKey {the received API token}.
For example: APIKey 7711$eyJ0eXAiOiJKV
Click Save & Test.
If everything is correct, you will see the following messages: "Datasource updated" and "You successfully authenticated as {Name}".
Click on the + in the menu to open the "Create" section, select "Dashboard" to add a new dashboard.
In the next window, click "Add an empty panel" to create a new panel.
Make sure that "cdn-stats" is set as the data source in the Query section.
Select the necessary metric, granularity, and grouping (you can select several).
The "Legend" field displays the values of the Group by field and the name of the metric by default:
You can customize the output of legend data.
Set a name for the metric and in brackets {{}} set the parameters specified in the Group by field.
For example, for the settings above, you can set the following format: Traffic quantity — {{resource}}.
Open the dashboard settings by clicking on the gear icon in the upper-right corner.
Go to the "Variables" section and click "Add variable". You can use it to filter the data on the chart.
For example, to be able to filter resources, you need to make the following settings and click "Update":
Go back to the dashboard by clicking the arrow icon in the upper-left corner of the screen.
Connect the variable with the Dashboard. To do this, specify its name in the "Resources" field of the "Filters (comma separated)" section.
Important! Enter "$" before the variable name.
Now you can choose resource data to be displayed on the chart.
Save the Dashboard. To do this, click "Save" in the upper-right corner of the panel.
Was this article helpful?
Learn more about our next-gen CDN