Skip to main content

Grafana

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

To visualize metrics, configure Grafana.

Configure 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 permissions in the Projects scope and role:

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

2. Start Grafana

For your information

These instructions are for starting Grafana locally. If you have an existing Grafana installation, start it using the Start the Grafana server instructions from the official Grafana documentation.

  1. Open the CLI.

  2. Start Grafana in Docker.

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

  2. To connect to Grafana, enter the default credentials: username (admin) and password (admin).

3. Configure a 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, enter the Metrics service endpoint in the Prometheus server URL field:

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

    Specify:

    • <base_url> — URL for accessing the Metrics API. If you are configuring an agent to collect dedicated server metrics, use the cloud server pool URL corresponding to the pool where your dedicated server is located. The list of URLs can be found in the Metrics subsection of the URL list instructions;
    • <project_id> — project ID. It can be copied in the Control panel: in the top menu, click Products and select Cloud servers → open the project menu → on the line of the desired project, click ;
    • <namespace> — name of the selected namespace, for example compute. Can be viewed in the Metrics reference instructions.
  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 of the user you added in step 1.

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

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 that you configured in step 3.

  6. On the Queries tab, in the Metrics field, enter the metric name. For more details on available metrics, see the Metrics reference instructions.

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

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

  9. Click Save dashboard.