Skip to main content

Grafana

Last update:

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

To visualize metrics, configure Grafana.

Configure Grafana

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

1. Add a service user

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

  • metrics.admin;
  • member;
  • or reader.

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

2. Start Grafana

For your information

This instruction is for running Grafana locally. If you already have a Grafana installation, start it using the Start the Grafana server guide in 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 the http://localhost:3000 page in your 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.

  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 URL field, enter the Metrics service endpoint:

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

    Specify:

    • <base_url> — API URL for the Metrics service. If you are configuring an agent to collect metrics for a dedicated server, use the cloud server pool URL that corresponds to the pool where your dedicated server is located. The list of URLs can be found in the URL list;
    • <project_id> — Project ID. You can copy it in the control panel: in the top menu, click Products and select Cloud servers → open the projects menu → in the row of the required project, click ;
    • <namespace> — the name of the selected namespace, for example, 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 user password you added in step 1.

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

4. Create a dashboard

  1. Launch 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. Learn more about available metrics in the Metrics reference.

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

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

  9. Click Save dashboard.