Skip to main content

Grafana

Last update:

Grafana is an open-source platform for real-time metric visualization and data analysis. The Metrics service fully supports integration with Grafana. This integration allows you to view historical metrics for 30 days 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 is an instruction for running Grafana locally. If you already have a Grafana installation, run it using the Start the Grafana server instruction 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 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> — the URL for accessing the Metrics service API. If you are configuring an agent to collect metrics from 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, enter the metric name in the Metrics field. Learn more about available metrics in the Metric 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.