search
数据采集 采集源配置 envoy 指标采集

envoy 指标采集

简介

采集 envoy 数据指标上报到 DataFlux 中。

前置条件

配置

envoy 配置

进入 DataKit 安装目录下的 conf.d/envoy 目录,复制 envoy.conf.sample 并命名为 envoy.conf。示例如下:

admin:
  access_log_path: "/dev/null"
  address:
    socket_address: { address: 127.0.0.1, port_value: 9901 }

运行 envoy 程序并指定配置文件,例如:

sudo envoy -c envoy_config.yaml

datakit 配置

打开 DataKit 采集源配置文件夹(默认路径为 DataKit 安装目录的 conf.d 文件夹),打开envoy/envoy.conf文件修改配置。

示例配置及说明如下:

[[inputs.prom]]
    # envoy 指标来源 http(https)://HOST:PORT/stats/prometheus
    # 通常只需要修改 host 和 port 即可
    # 必填
    url = "http://127.0.0.1:9901/stats/prometheus"

    # 采集间隔时长,数字+单位,有效的时间单位 "ns", "us" (or "µs"), "ms", "s", "m", "h"
    # 不可以小于等于 0
    # 必填
    interval = "10s"

    # 是否开启 HTTPS TLS,如果开启则需要同时配置下面的3个路径
    tls_open = false
    # tls_ca = "/tmp/ca.crt"
    # tls_cert = "/tmp/peer.crt"
    # tls_key = "/tmp/peer.key"

    # 自定义 tags
    # 建议配置以区分数据来源
    # [inputs.prom.tags]
    # from = "127.0.0.1:9901"
    # tags1 = "value1"

说明:

  • 如果 envoy 接口需要使用 HTTPS 访问,需要在配置文件中将tls_open设置为true,且配置3个证书和私钥文件路径
  • 使用命令例如curl 127.0.0.1:9901/stats/prometheus 根据返回内容判断是否需要使用 HTTPS
  • 使用命令例如curl --cacert ca.crt --cert peer.crt --key peer.key -L https://127.0.0.1:9901/stats/prometheus 验证 tls 证书和私钥是否可用
  • 证书和私钥码只支持 PEM 编码

采集指标

指标 类型 单位
envoy_cluster_manager_active_clusters fields float
envoy_cluster_manager_cluster_added fields float
envoy_cluster_manager_cluster_modified fields float
envoy_cluster_manager_cluster_removed fields float
envoy_cluster_manager_cluster_updated fields float
envoy_cluster_manager_cluster_updated_via_merge fields float
envoy_cluster_manager_update_merge_cancelled fields float
envoy_cluster_manager_update_out_of_merge_window fields float
envoy_cluster_manager_warming_clusters fields float
envoy_filesystem_flushed_by_timer fields float
envoy_filesystem_reopen_failed fields float
envoy_filesystem_write_buffered fields float
envoy_filesystem_write_completed fields float
envoy_filesystem_write_failed fields float
envoy_filesystem_write_total_buffered fields float
envoy_http1_dropped_headers_with_underscores fields float
envoy_http1_metadata_not_supported_error fields float
envoy_http1_requests_rejected_with_underscores_in_headers fields float
envoy_http1_response_flood fields float
envoy_listener_admin_downstream_cx_active fields float
envoy_listener_admin_downstream_cx_destroy fields float
envoy_listener_admin_downstream_cx_length_ms_count fields float
envoy_listener_admin_downstream_cx_length_ms_sum fields float
envoy_listener_admin_downstream_cx_overflow fields float
envoy_listener_admin_downstream_cx_total fields float
envoy_listener_admin_downstream_global_cx_overflow fields float
envoy_listener_admin_downstream_pre_cx_active fields float
envoy_listener_admin_downstream_pre_cx_timeout fields float
envoy_listener_admin_main_thread_downstream_cx_active fields float
envoy_listener_admin_main_thread_downstream_cx_total fields float
envoy_listener_admin_no_filter_chain_match fields float
envoy_listener_manager_listener_added fields float
envoy_listener_manager_listener_create_failure fields float
envoy_listener_manager_listener_create_success fields float
envoy_listener_manager_listener_in_place_updated fields float
envoy_listener_manager_listener_modified fields float
envoy_listener_manager_listener_removed fields float
envoy_listener_manager_listener_stopped fields float
envoy_listener_manager_total_filter_chains_draining fields float
envoy_listener_manager_total_listeners_active fields float
envoy_listener_manager_total_listeners_draining fields float
envoy_listener_manager_total_listeners_warming fields float
envoy_listener_manager_workers_started fields float
envoy_runtime_admin_overrides_active fields float
envoy_runtime_deprecated_feature_seen_since_process_start fields float
envoy_runtime_deprecated_feature_use fields float
envoy_runtime_load_error fields float
envoy_runtime_load_success fields float
envoy_runtime_num_keys fields float
envoy_runtime_num_layers fields float
envoy_runtime_override_dir_exists fields float
envoy_runtime_override_dir_not_exists fields float
envoy_server_concurrency fields float
envoy_server_days_until_first_cert_expiring fields float
envoy_server_debug_assertion_failures fields float
envoy_server_dynamic_unknown_fields fields float
envoy_server_envoy_bug_failures fields float
envoy_server_hot_restart_epoch fields float
envoy_server_hot_restart_generation fields float
envoy_server_initialization_time_ms_count fields float
envoy_server_initialization_time_ms_sum fields float
envoy_server_live fields float
envoy_server_main_thread_watchdog_mega_miss fields float
envoy_server_main_thread_watchdog_miss fields float
envoy_server_memory_allocated fields float
envoy_server_memory_heap_size fields float
envoy_server_memory_physical_size fields float
envoy_server_parent_connections fields float
envoy_server_state fields float
envoy_server_static_unknown_fields fields float
envoy_server_stats_recent_lookups fields float
envoy_server_total_connections fields float
envoy_server_uptime fields float
envoy_server_version fields float
envoy_server_watchdog_mega_miss fields float
envoy_server_watchdog_miss fields float