Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Monitoring
  • Getting started
    • Overview
    • Installing and updating
    • Starting and stopping
    • Agent best practices
    • Possible errors
    • Deletion
  • Access management
  • Terraform reference
  • Release notes

In this article:

  • One agent per host
  • Agent monitoring
  • Using storage
  • Calculation of CPU usage time
  1. Metric collection agent
  2. Agent best practices

Agent best practices

Written by
Yandex Cloud
Updated at March 6, 2025
  • One agent per host
  • Agent monitoring
  • Using storage
  • Calculation of CPU usage time

One agent per hostOne agent per host

Avoid running more than one Unified Agent instance on the same host with the same configuration files since that might cause problems with the agent.

Agent monitoringAgent monitoring

When using Unified Agent, we recommend that you enable collecting health metrics for the agent.

To do so, add a delivery route with the agent_metrics input to the agent configuration. Configuration example:

status:
  port: 16241

routes:
  - input:
      plugin: agent_metrics
      config:
        namespace: ua
    channel:
      pipe:
        - filter:
            plugin: filter_metrics
            config:
              match: "{scope=health}"
      output:
        plugin: yc_metrics
        config:
          folder_id: "$FOLDER_ID"
          iam:
            cloud_meta: {}

See also agent_metrics input.

Using storageUsing storage

Use a storage to reliably deliver metrics to Yandex Monitoring with Unified Agent. It will let you temporarily store messages sent over a pipe before being passed on to the channel output.

Using a storage can help you avoid data loss if the agent fails to write the data to the specified output (including repeat attempts). This may happen due to network issues or destination API unavailability.

Example of agent configuration with a storage:

status:
  port: 16241

storages:
  - name: main
    plugin: fs
    config:
      directory: /var/lib/yandex/unified_agent/main
      max_partition_size: 1gb
      max_segment_size: 500mb

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:
        poll_period: 15s
        namespace: sys
    channel:
      channel_ref:
        name: cloud_monitoring

See also Storages.

Calculation of CPU usage timeCalculation of CPU usage time

Before, to indicate the percentage of CPU usage on the chart, the sys.system.CpuUsagePercent metric was used. Linux no longer provides this metric; however, you can calculate it using the following two metrics:

  • sys.system.UsefulTime: CPU active usage time.
  • sys.system.IdleTime: CPU idle time.

To add a CPU usage percentage chart to a dashboard:

  1. Install and run Unified Agent.

  2. Open the dashboard you need or create a new one.

  3. In the upper-right corner, click and select Chart to add a new widget to the dashboard.

  4. In the new widget, create three requests in text mode (the icon):

    1. UsefulTime request:

      "sys.system.UsefulTime"{folderId = "<folder_ID>", service = "custom", cpu  = "-"}
      

      Where <folder_ID> is the ID of the folder your dashboard is located in.

      Click the icon to hide this metric from the chart.

    2. IdleTime request:

      "sys.system.IdleTime"{folderId = "<folder_ID>", service = "custom", cpu = "-"}
      

      Where <folder_ID> is the ID of the folder your dashboard is located in.

      Click the icon to hide this metric from the chart.

    3. CpuUsagePercent request:

      100 * UsefulTime / (IdleTime + UsefulTime)
      
  5. Click Execute query and make sure you can see the chart with CPU usage.

  6. In the upper-right corner, click to save your widget.

Was the article helpful?

Previous
Service
Next
Possible errors
Yandex project
© 2025 Yandex.Cloud LLC