Skip to main content

Grafana

Last update:

Grafana - an open source platform for real-time metrics visualization and data analysis. Metrics Service supports full integration with Grafana. The integration allows you to view historical metrics for 30 days and build analytical queries for metrics.

To visualize the metrics , configure Grafana.

Customize Grafana

  1. Add a service user.
  2. Start Grafana.
  3. Configure the data source.
  4. Create a dashboard.

1. Add a service user

Add a service user with permission in the access area Projects and role:

  • metrics.admin;
  • I'm a member;
  • or reader.

Users can be added by the Account Owner or users with the role of iam.admin.

2. Start Grafana

For your information

These are instructions for running Grafana locally. If you have a ready installation of Grafana, start it using the Start the Grafana server instructions in the official Grafana documentation.

  1. Open the CLI.

  2. Run Grafana in Docker.

docker run -d -p 3000:3000 --name=grafana grafana/grafana
  1. Open the page http://localhost:3000 in your browser.

  2. To connect to Grafana, enter the default login (admin) and password (admin).

3. Customize the data source

  1. Start Grafana.

  2. Go to the Data Sources section.

  3. Click Add data source.

  4. Select Prometheus.

  5. In the Name field, specify a name for the data source.

  6. In the Connection block, in the Prometheus server field, the URL of the Metrics service endpoint:

    <base_url>/projects/<project_id>/namespaces/<namespace>

    Specify:

    • <base_url> - URL for accessing the API of the Metrics service. The list of URLs can be found in the instructions List of URLs;
    • <project_id> - Project ID. Can be copied in control panel: in the top menu click Products and select Cloud Servers → open the projects menu → in the row of the desired project, click ;
    • <namespace> - the name of the selected namespace, e.g. compute.
  7. In the Authentication method field, select Basic authentication.

  8. In the User field, enter the ID of the user you added in step 1;

  9. In the Password field, enter the password for the user you added in step 1.

  10. Click Save & test and wait for the test request to execute.

4. Create a dashboard

  1. Start Grafana.

  2. Go to the Dashboards section.

  3. Click Create dashboard.

  4. Click Add visualization.

  5. Select the Prometheus data source you configured in step 3.

  6. On the Queries tab, in the Metrics field, enter the name of the metric. For more information about available metrics, see the Metrics Reference manual.

  7. Optional: to add multiple metrics, click Add query and repeat step 5.

  8. To display the metrics values on the dashboard, click Run queries.

  9. Click Save dashboard.