sample-ppem-agent.yml

sample-ppem-agent.yml — Пример YAML-файла конфигурации для агента

Обзор

Это пример файла конфигурации для агента PPEM.

Подробные описания параметров содержатся в соответствующем справочном руководстве по файлу конфигурации.

Пример файла конфигурации

# Общие параметры агента
agent:
  # Основные параметры
  name: уникальное_имя_агента
  remote_config: использовать_конфигурацию_с_удалённого_сервера

  # Параметры подключения к менеджеру
  manager:
    url: "http://127.0.0.1:8080"
    api_key: API_ключ_для_подключения_к_менеджеру
    # HTTPS is disabled by default
    tls:
      cert_file: ""
      key_file: ""
      root_ca_file: ""
      insecure_skip_verify: false
    strict_address_checking: false
    allowed_addresses: []

  # Параметры обнаружения экземпляров
  instance:
    connection_defaults:
      host: "localhost"
      port: 5432
      database: "postgres"
      user: "postgres"
      password: "postgres"
      password_file: путь_к_файлу_паролей
      sslmode: ""
      sslrootcert: ""
      sslcert: ""
      sslkey: ""

  # Параметры автоматического обнаружения
  autodiscovery:
    instance_name_template: ""

  # Параметры выполнения команд
  commands:
    max_workers: 6
    timeout: "5h"
    feedback_interval: "30s"
    allowed_bindirs:
      paths: []

  # Параметры сборщиков, которые обнаруживают объекты
  collectors:
    timeout: "30m"
    host:
      interval: "1m"
      bindirs:
        paths: []
    agent:
      interval: "1m"
    instances:
      disabled: false
      interval: "1m"
    instance_objects:
      batch_size: 1000
      interval: "1m"
      initial_delay: "0s"
      jitter_interval: "0s"
      extended:
        enabled: true
        schedule: ""
    instance_settings:
      interval: "1m"
    replication:
      interval: "10s"

  # Системные параметры
  system:
    systemd_units_path: ""
    postgresql_configs_path: ""

  # Параметры различных временных интервалов и тайм-аутов
  reconnection_delay: "2s"
  connect_timeout: "2s"
  request_timeout: "2s"
  read_timeout: "30s"
  write_timeout: "2s"
  ping_interval: "24s"
  max_connections: 0

# Параметры журналирования
log:
  level: уровень_журналирования
  format: "json"
  options:
    csv_field_delimiter: ","
  file:
    path: абсолютный_путь_к_файлу_журнала
    mode: режим_доступа_к_файлу_журнала
    rotation_age: ""
    rotation_size: ""

# Параметры HTTP
http:
  server:
    address: "localhost"
    port: 8080
    tls:
      cert_file: ""
      key_file: ""
    timeout: "10s"
    security:
      enabled: false
      csp_policy: >-
        default-src 'none';
        script-src 'self' 'unsafe-eval';
        style-src 'self' 'unsafe-inline';
        img-src 'self' data: blob:;
        font-src 'self';
        connect-src 'self';
        media-src 'self';
        form-action 'self';
        base-uri 'self';
        frame-ancestors 'none';
        frame-src https://postgrespro.com/;
        object-src 'none'
      cache_control: "no-store, no-cache, must-revalidate"
      pragma: "no-cache"
      expires: 0
      frame_options: ""
      content_type_options: ""
      permissions_policy: >-
        accelerometer=(),
        autoplay=(),
        camera=(),
        geolocation=(),
        gyroscope=(),
        magnetometer=(),
        microphone=(),
        payment=(),
        usb=()
      referrer_policy: "strict-origin-when-cross-origin"
      strict_transport_security: ""
      cross_origin_embedder_policy: заголовок_cross_origin_embedder_policy
      cross_origin_opener_policy: заголовок_cross_origin_opener_policy
      cross_origin_resource_policy: заголовок_cross_origin_resource_policy
  client:
    timeouts:
      http: "10s"
      tls_handshake: "2s"
      dialer: "2s"
      response_header: "10s"
    insecure_skip_verify: false
    root_ca_files: []
  pagination:
    max_page_size: 100

# Параметры JWT-сеансов
jwt:
  secret: "secret"
  lifetime:
    access: "30m"
    refresh: "24h"

# Параметры OpenTelemetry (OTLP)
otlp:
  traces:
    sampler_ratio: 1.0
    exporter:
      protocol: ""
      endpoint_url: URL_конечной_точки_для_экспорта_трассировок
      tls:
        insecure_skip_verify: false

sample-ppem-agent.yml

sample-ppem-agent.yml — Sample YAML configuration file for the agent

Overview

This is the sample configuration file for the PPEM agent.

The corresponding configuration file reference contains the detailed parameter descriptions.

Sample Configuration File

# General agent parameters
agent:
  # Core parameters
  name: unique_agent_name
  remote_config: toggle_use_of_remote_configuration

  # Manager connection parameters
  manager:
    url: "http://127.0.0.1:8080"
    api_key: API_key_for_connecting_to_manager
    # HTTPS is disabled by default
    tls:
      cert_file: ""
      key_file: ""
      root_ca_file: ""
      insecure_skip_verify: false
    strict_address_checking: false
    allowed_addresses: []

  # Instance discovery parameters
  instance:
    connection_defaults:
      host: "localhost"
      port: 5432
      database: "postgres"
      user: "postgres"
      password: "postgres"
      password_file: path_to_password_file
      sslmode: ""
      sslrootcert: ""
      sslcert: ""
      sslkey: ""

  # Automatic discovery parameters
  autodiscovery:
    instance_name_template: ""

  # Command execution parameters
  commands:
    max_workers: 6
    timeout: "5h"
    feedback_interval: "30s"
    allowed_bindirs:
      paths: []

  # Discovery collectors parameters
  collectors:
    timeout: "30m"
    host:
      interval: "1m"
      bindirs:
        paths: []
    agent:
      interval: "1m"
    instances:
      disabled: false
      interval: "1m"
    instance_objects:
      batch_size: 1000
      interval: "1m"
      initial_delay: "0s"
      jitter_interval: "0s"
      extended:
        enabled: true
        schedule: ""
    instance_settings:
      interval: "1m"
    replication:
      interval: "10s"

  # System parameters
  system:
    systemd_units_path: ""
    postgresql_configs_path: ""

  # Miscellaneous time interval and timeout parameters
  reconnection_delay: "2s"
  connect_timeout: "2s"
  request_timeout: "2s"
  read_timeout: "30s"
  write_timeout: "2s"
  ping_interval: "24s"
  max_connections: 0

# Logging parameters
log:
  level: logging_level
  format: "json"
  options:
    csv_field_delimiter: ","
  file:
    path: absolute_path_to_log_file
    mode: access_mode_of_log_file
    rotation_age: ""
    rotation_size: ""

# HTTP parameters
http:
  server:
    address: "localhost"
    port: 8080
    tls:
      cert_file: ""
      key_file: ""
    timeout: "10s"
    security:
      enabled: false
      csp_policy: >-
        default-src 'none';
        script-src 'self' 'unsafe-eval';
        style-src 'self' 'unsafe-inline';
        img-src 'self' data: blob:;
        font-src 'self';
        connect-src 'self';
        media-src 'self';
        form-action 'self';
        base-uri 'self';
        frame-ancestors 'none';
        frame-src https://postgrespro.com/;
        object-src 'none'
      cache_control: "no-store, no-cache, must-revalidate"
      pragma: "no-cache"
      expires: 0
      frame_options: ""
      content_type_options: ""
      permissions_policy: >-
        accelerometer=(),
        autoplay=(),
        camera=(),
        geolocation=(),
        gyroscope=(),
        magnetometer=(),
        microphone=(),
        payment=(),
        usb=()
      referrer_policy: "strict-origin-when-cross-origin"
      strict_transport_security: ""
      cross_origin_embedder_policy: cross_origin_embedder_policy_header
      cross_origin_opener_policy: cross_origin_opener_policy_header
      cross_origin_resource_policy: cross_origin_resource_policy_header
  client:
    timeouts:
      http: "10s"
      tls_handshake: "2s"
      dialer: "2s"
      response_header: "10s"
    insecure_skip_verify: false
    root_ca_files: []
  pagination:
    max_page_size: 100

# JWT session parameters
jwt:
  secret: "secret"
  lifetime:
    access: "30m"
    refresh: "24h"

# OpenTelemetry (OTLP) parameters
otlp:
  traces:
    sampler_ratio: 1.0
    exporter:
      protocol: ""
      endpoint_url: collector_endpoint_URL_for_exporting_traces
      tls:
        insecure_skip_verify: false
FAQ