Grafana
Grafana - An open source platform for visualizing metrics and analyzing real-time data.Metrics Service supports full integration with Grafana.The integration allows you to view historical metrics for 30 days and build analytical queries on metrics.
To visualize the metrics , configure Grafana.
Customize Grafana
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
These are instructions for running Grafana locally.If you have a pre-built installation of Grafana, run it using the Start the Grafana server instructions in the official Grafana documentation.
-
Open the CLI.
-
Run Grafana in Docker.
docker run -d -p 3000:3000 --name=grafana grafana/grafana
-
Open the page
http://localhost:3000in your browser. -
To connect to Grafana, enter the default login
(admin) and password (admin).
3. Customize the data source
-
Go to the Data Sources section.
-
Click Add data source.
-
Select Prometheus.
-
In the Name field, specify a name for the data source.
-
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.
-
In the Authentication method field, select Basic authentication.
-
In the User field, enter the ID of the user you added in step 1;
-
In the Password field, enter the password for the user you added in step 1.
-
Click Save & test and wait for the test request to execute.
4. Create a dashboard
-
Go to the Dashboards section.
-
Click Create dashboard.
-
Click Add visualization.
-
Select the Prometheus data source you configured in step 3.
-
On the Queries tab, in the Metrics field, enter the name of the metric.For more information about available metrics, see the Metrics Reference instructions.
-
Optional: to add multiple metrics, click Add query and repeat step 5.
-
To display the metrics values on the dashboard, click Run queries.
-
Click Save dashboard.