Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex Monitoring
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Working with metrics
      • Delivering Linux system metrics
      • Delivering custom application metrics
      • Delivering metrics from HAProxy and other third-party applications
      • Delivering metrics from hosts outside Yandex Cloud
      • Writing custom metrics via the API
      • Getting a list of metrics
      • Downloading metrics
      • Exporting metrics in Prometheus format
    • Working with dashboards
      • Creating dashboards
      • Copying dashboards
      • Adding widgets to a dashboard
      • Deleting widgets from a dashboard
      • Deleting dashboards
      • Examples of working with the gRPC API
    • Working with alerts
      • Creating alerts
      • Creating notification channels
      • Deleting alerts
  • Concepts
    • Service overview
    • Data model
    • Visualization
      • Overview
      • Query string
      • Widgets
      • Dashboards
    • Transmitting metrics
      • Agent for delivering metrics
        • Overview
        • Installation and startup
        • Configuration
        • Best practices for using the agent
    • Query language
    • Alerting
    • Data decimation
    • Deleting expired metrics (TTL)
    • Quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Policy before October 1, 2020
  • API reference
    • Authentication in the API
    • REST
      • Overview
      • MetricsData
        • Overview
        • read
        • write
        • prometheusMetrics
      • MetricsMeta
        • Overview
        • listLabelKeys
        • listLabelValues
        • listMetricNames
        • listMetrics
    • gRPC
      • Overview
      • DashboardService
  • Metric reference
  • Questions and answers
    • General questions
    • Navigation
    • Metric collection and export
    • Metrics and units of measure
    • Alerts / notifications
    • All questions on one page
  1. Concepts
  2. Transmitting metrics
  3. Agent for delivering metrics
  4. Best practices for using the agent

Best practices for using the agent

Written by
Yandex Cloud
  • One agent per host
  • Agent monitoring
  • Using storage

This section offers recommendations for using Yandex Unified Agent.

One 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 monitoring

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

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

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 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). That might happen because of network issues or destination API unavailability.

Sample 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.

Was the article helpful?

Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
In this article:
  • One agent per host
  • Agent monitoring
  • Using storage