Visualizing Monitoring data
The scenario will be useful to those users who have already deployed and launched one of the Yandex Cloud services.
You will create a chart based on the Yandex Monitoring query language and place it on the dashboard.
To visualize and explore data, set up DataLens and follow the steps below:
- Create a connection.
- Create a QL chart.
- Create a dashboard.
- Add the QL chart to the dashboard.
- Add selectors to the dashboard.
Getting started
To get started with DataLens:
-
Log in
to your Yandex account. -
Open the DataLens home page
. -
Click Open Datalens.
-
Select one of the options:
-
If you already have an organization, select it from the drop-down menu in the Organizations tab and click Open DataLens.
Note
To activate a DataLens instance, the user must have the
admin
orowner
role. For more information about roles, see Access management in Yandex Cloud Organization. -
If you have a cloud but no organization, click Add new DataLens. In the window that opens, enter your organization's name and description and click Create organization and DataLens. For more information about working with organizations, see Getting started with organizations.
If you have any technical questions about the service, please contact the Yandex Cloud support
. To ask for advice, discuss the solution to your problem or best practices of the service, write to the DataLens chat in Telegram. -
Create a connection
Note
To create a connection, you need a service account with the monitoring.viewer
or viewer
role.
Use the Yandex Monitoring query language to write queries in QL charts.
Connecting to Monitoring
To create a Monitoring connection:
-
Go to the connections page
. -
Click Create connection.
-
Select a Monitoring connection.
-
Specify the connection parameters:
- Cloud and folder: Select the folder where your service account is located.
- Service account: Select an existing service account or create a new one.
-
Click Create connection.
-
Enter the connection name and click Create. The connection will appear in the list.
Create a QL chart
-
Go to the created connection.
-
In the top-right corner, click Create QL chart.
-
On the Query tab, enter the query code. You can either write it or copy it from Monitoring.
How to copy a query from Monitoring
-
Go to the dashboard you need in Monitoring. For dashboard availability, you must be running one of the Yandex Cloud services.
-
To open the required chart in Metric Explorer, click
in the top-right corner of the chart. -
At the bottom of the screen, go to the Queries tab.
-
In the line with the required query, click
and select Copy as text. In DataLens, enter the query without thefolderId
parameter.Example of a query in Monitoring:
"cpu_usage"{folderId="b1g9r5h41935********", service="compute", resource_id="charts-prod-vla-1"}
In DataLens, enter the query without the
folderId
parameter:"cpu_usage"{service="compute", resource_id="charts-prod-vla-1"}
-
-
On the Parameters tab, specify the required time interval.
-
Click Start. Check that the query is executed without errors and the chart with the data is displayed.
-
In the top-right corner, click Save.
-
Enter the chart name
Monitoring Data Chart
and click Save.
You can place the chart created on the dashboard. You can also add a selector to the dashboard to control the QL chart interval
parameter.
Create a dashboard
Create a dashboard to add these charts to.
-
Go to the DataLens home page
. -
Click Create dashboard.
Add the QL chart to the dashboard
-
At the top of the page, click Add and select Chart.
-
In the Chart field, click Select and select the previously created
Monitoring Data Chart
chart from the chart list.Click Add.
-
The chart is displayed on the dashboard. Stretch it to improve visualization.
-
Save the dashboard:
- In the top-right corner, click Save.
- Enter
Monitoring Data
as the dashboard name and click Create.
Add selectors to the dashboard
Add a selector to select the time interval for which the data is displayed:
-
At the top of the page, click Add.
-
Choose Selector.
-
Select Manual input as the source type.
-
Under Field or parameter name, enter
interval
. Certain selector values will be passed into this query variable. -
Choose Calendar as your selector type.
-
Enable Range.
-
In the Default value field, specify the values in offsets from the current date and click Apply.
-
Enable the Name option and enter
Date interval
. -
Click Add.
-
Place the selector on the dashboard under the chart.
-
Save the dashboard.
-
Your dashboard is ready. You can now select the time interval using the selector.