Delivering Linux system metrics
Yandex Monitoring gets general virtual machine metrics from Yandex Compute Cloud. For example, the amount of RAM allocated to a VM at the start. However, you can measure how a VM utilizes its memory only by collecting data within that VM. Yandex Unified Agent is a utility that collects and transmits such metrics.
Warning
Delivery of system metrics for virtual machines run on Windows and macOS is planned for upcoming Yandex Unified Agent releases.
To configure Yandex Unified Agent to collect system metrics from a Yandex Cloud VM, follow these steps:
-
Set up a service account under which metrics will be written to Yandex Monitoring.
-
Create a service account in the folder you want to write metrics to and assign it the
monitoring.editor
role. -
Link your service account to a virtual machine with Unified Agent installed.
-
-
Install and configure Yandex Unified Agent:
-
Create a file named config.yml in your home folder.
config.yml:
status: port: "16241" storages: - name: main plugin: fs config: directory: /var/lib/yandex/unified_agent/main max_partition_size: 100mb max_segment_size: 10mb channels: - name: cloud_monitoring channel: pipe: - storage_ref: name: main output: plugin: yc_metrics config: folder_id: "$FOLDER_ID" iam: cloud_meta: {} routes: - input: plugin: linux_metrics config: namespace: sys channel: channel_ref: name: cloud_monitoring - input: plugin: agent_metrics config: namespace: ua channel: pipe: - filter: plugin: filter_metrics config: match: "{scope=health}" channel_ref: name: cloud_monitoring import: - /etc/yandex/unified_agent/conf.d/*.yml
Where
$FOLDER_ID
is the ID of the folder you want to write metrics to. -
Install Unified Agent on your VM by running the following command in the home folder:
docker run \ -p 16241:16241 -it --detach --uts=host \ --name=ua \ -v `pwd`/config.yml:/etc/yandex/unified_agent/config.yml \ -v /proc:/ua_proc \ -e PROC_DIRECTORY=/ua_proc \ -e FOLDER_ID=a1bs81qpemb4******** \ cr.yandex/yc/unified-agent
You can find more ways to install the agent in Installing and running Yandex Unified Agent.
-
-
Make sure the metrics are delivered to Yandex Monitoring:
-
On the Yandex Monitoring home page
, go to Metric Explorer. -
In the query block, select:
- Folder where metrics are collected.
service=custom
label value.- Metric name starting with the
sys
prefix.
-