Attention
You have Cookie disabled in your browser. Displaying the site will be incorrect!
en de

How to get CDN statistics in Grafana

Grafana is a tool for working with monitoring metrics. With it, you can get statistics in a user-friendly visual format and track CDN.

We have released a plugin that will allow users to get G-Core Labs CDN statistics in Grafana as easily as possible. Below, we will tell you what CDN monitoring capabilities Grafana comes with, how to connect the plugin and streamline statistics operations.

Grafana at a glance

Grafana is an open-source monitoring tool designed to visualize and work with statistical data. It is chiefly intended to transform metrics into a user- and human-friendly visual form.

Grafana does not collect or store anything. But you can connect the plugin to the system where statistics is accumulated in the form of cold, hard numbers and it will convert such data into a convenient graph, a simple table, or a diagram.

Metrics can be sourced from virtually any data storage system. Statistics can be aggregated from different sources in one place.

Grafana has dozens of visualization methods. Data can be graphed, diagrammed, distributed, or presented in absolute values. Data can be grouped and aggregated into interactive dashboards.

How to get CDN statistics in Grafana

You can configure variables and use them to switch between the data displayed on the dashboard, filter metrics, change the period of time for which statistics is displayed, and so on. Grafana has everything to work with statistics and efficiently analyze data.

How Grafana helps monitor CDN

Statistics, with which you can check the CDN efficiency, comes from your provider. But Grafana will help you “wrap up” the figures in user-friendly graphs and group information the way you want it.

Grafana will come in handy if you use multi-CDN. The tool will allow you to aggregate statistics from different providers in one place and determine how to best distribute traffic between different content delivery networks.

Besides, Grafana has many useful features to work with CDN statistics. For example, if you receive data on the traffic consumed, you can configure notifications and Grafana will alert you every time traffic consumption hits a certain figure. That way, you can control consumption and avoid overages.

How to get G-Core Labs CDN statistics via Grafana

We provide statistics on:

  • total traffic volume
  • cached traffic volume
  • traffic from CDN servers
  • traffic from origin shielding
  • origin traffic
  • number of requests
  • number of 2xx, 3xx, 4xx, and 5xx responses

In Grafana, you can group these metrics by the following parameters:

  • clients
  • CDN resources
  • regions
  • countries
  • data centers

For example, you can check how much traffic comes from this or that country and see how the load is distributed.

In the early days, you could get G-Core Labs CDN statistics in Grafana via API only. And you had to make complex adjustments, which took time.

And now you can connect our CDN to Grafana and get necessary metrics virtually in a few clicks with the plugin that we released specifically to make your statistics operations easier.

How to install the plugin

1. Download and install Grafana. The tool can be installed on any OS.

If you are connected to G-Core Labs Cloud, you can download Grafana from our marketplace.

2. Launch the tool in the browser. For that, type the default path in the address bar: http://localhost:3000/.

3. Enter the default login and password: admin/admin. Once you click Log in, you will be prompted to change password.

How to get CDN statistics in Grafana

4. Download the latest version of our plugin from GitHub.

5. Extract the archive contents into the Grafana plugin folder. By default, it is [installation_folder]Grafanalabgrafanadataplugins.

6. Restart Grafana. Check our tutorial to see how to do it for different OSs.

How to connect the plugin to Grafana

1. Add data source. Go to Data Sources in Grafana, click Add data source and select G-Core Labs from the list.

2. Paste an API token into the Auth header field.

You can get a token in your CDN profile:

  • In your profile, go to API tokens and click Create token.
  • Enter the token creator name, role, and expiry time (if required) and click Create.
  • Copy the token in the new window.

Paste the token into the Auth header field as APIKey {API token}. For example, APIKey 7711$eyJ0eXAiOiJKV.

Click Save & Test. If you did everything right, you will see the message that authentication is successfully completed:

How to get CDN statistics in Grafana

How to add and configure statistics dashboard

1. Add a new dashboard. In the side menu, click + and select Dashboard.

2. Add and configure a panel. Click Add an empty panel. In the new window, select cdn-stats as a data source:

How to get CDN statistics in Grafana

Select metrics, granularity and groupings you need. You can select several groupings.

3. Add and configure a variable. With the variable, you can filter data in the graph. You can add several variables for different parameters.

We will tell you how to add and configure a variable to filter resources. The same will apply to other variables.

In order to add a variable, click the Settings icon at the top:

How to get CDN statistics in Grafana

Select Variables and click Add variable.

Then, you have to configure the variable:

  1. Enter its name.
  2. Select the value: resourceID or client.
  3. Should you so wish, you can specify the order, in which elements are sorted.
  4. Optionally, you can specify the order, in which elements are highlighted: Multi-value—selects several values at a time, Include All option—includes the All value.
  5. Click Update.

How to get CDN statistics in Grafana

4. Bind the variable to the dashboard.

Go back to the dashboard:

How to get CDN statistics in Grafana

And enter the variable name in the resource filter (Filters section, Resources field). Type in $ before the name.

That done, you can decide the data of which resources you want to display in the graph.

How to get CDN statistics in Grafana

5. Save the dashboard. In order to save the dashboard, click Save in the top right corner.

Your dashboard is now configured and ready for use.

Check our video tutorial to learn how to connect the plugin, add and configure the statistics dashboard:

Conclusions

  1. Grafana is a simple and useful tool to work with statistics.
  2. Grafana makes CDN monitoring and traffic consumption analysis more convenient, as it can aggregate statistics from different CDN providers in one place, which is very useful if you use multi-CDN.
  3. Our new plugin makes it possible to connect G-Core Labs CDN to Grafana and receive necessary metrics in a user-friendly format in just a few clicks.

Deliver the content instantaneously anywhere in the world with the powerful and reliable G-Core Labs CDN. Advanced CDN features and user-friendly statistics will allow you to use resources as effectively and efficiently as possible.

Do you want to test our CDN? Select a free plan or use a two-week trial period. Or get a free consultation.

Subscribe to a useful newsletter

Favorable offers and important news once a month. No spam