Data visualization Yandex Monitoring
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.
Before you begin
To get started with DataLens:
-
Log in to your Yandex account.
-
Open the DataLens homepage.
-
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 Granting permissions in 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 a technical question about the service, please contact 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 Yandex Monitoring
To create a Yandex Monitoring connection:
-
Go to the connections page.
-
Click Create connection.
-
Select a Yandex 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 appears in the list.
Create a QL chart
-
Go to the created connection.
-
In the top right-hand corner, click Create QL chart.
-
On the Query tab, enter the query code. You can either write it or copy it from Yandex Monitoring.
How to copy a query from Yandex Monitoring-
Go to the desired dashboard in Yandex Monitoring. For dashboard availability, you must be running one of the Yandex Cloud services.
-
To open the desired chart in Metric Explorer, click
-
At the bottom of the screen, go to the Queries tab.
-
In the line with the desired query, click
Example query:
alias(series_max("systag", trunc("mem.*"{service="managed-clickhouse", host="rc1a-jn5r2zlul3iydlo2.mdb.yandexcloud.net", resource_id="Test", resource_type="cluster", node="*", systag!="-"})), "{{systag}}")
-
-
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 upper right-hand 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 homepage.
-
Click Create dashboard.
-
Enter the dashboard name
Monitoring Data
and click Create.The dashboard created will open for editing.
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.
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 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 Title 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.