数据采集 采集源配置 CoreDNS 指标采集
CoreDNS 指标采集
简介
采集 CoreDNS 数据指标上报到 DataFlux 中。
前置条件
- 已安装 CoreDNS(官网)
- 已安装 DataKit(DataKit 安装文档)
配置
CoreDNS 配置
需要开启 CoreDNS 的指标采集功能,创建或修改配置文件 Corefile
,例如:
# Corefile
.:53 {
errors # 启用错误记录
prometheus :9153 # 启用Prometheus指标。9153/metrics
# ..
}
DataKit 配置
进入 DataKit 安装目录下的 conf.d/network
目录,复制 coredns.conf.sample
并命名为 coredns.conf
。示例配置及说明如下:
[[inputs.prom]]
# coredns 指标来源 http://HOST:PORT/metrics
# 通常只需要修改 host 和 port 即可
# 必填
url = "http://127.0.0.1:9153/metrics"
# 采集间隔时长,数字+单位,有效的时间单位 "ns", "us" (or "µs"), "ms", "s", "m", "h"
# 不可以小于等于 0
# 必填
interval = "10s"
# 自定义 tags
# 建议配置以区分数据来源
# [inputs.prom.tags]
# from = "127.0.0.1:9153"
# tags1 = "value1"
采集指标
- coredns 指标集(coredns v1.7)
指标 | 描述 | 类型 | 单位 |
---|---|---|---|
coredns_panics_total | panic计数。 | float | Shown as count |
go_gc_duration_seconds_count | GC调用的持续时间。 | float | Shown as second |
go_gc_duration_seconds_sum | GC调用的持续时间之和。 | float | Shown as second |
go_goroutines | 当前存在的goruntine数量 | float | Shown as thread |
go_memstats_alloc_bytes | 已分配并仍在使用的字节数。 | float | Shown as byte |
go_memstats_alloc_bytes_total | 已分配的字节总数,包括被释放的。 | float | Shown as byte |
go_memstats_buck_hash_sys_bytes | 分析存储区哈希表使用的字节数。 | float | Shown as byte |
go_memstats_frees_total | free总数。 | float | Shown as byte |
go_memstats_gc_cpu_fraction | 程序启动以来GC和程序使用的CPU时间比。 | float | Shown as percent |
go_memstats_gc_sys_bytes | 用于GC的系统元数据字节数。 | float | Shown as byte |
go_memstats_heap_alloc_bytes | 已分配且仍在使用的堆字节数。 | float | Shown as byte |
go_memstats_heap_idle_bytes | 等待使用的堆字节数。 | float | Shown as byte |
go_memstats_heap_inuse_bytes | 正在使用的堆字节数。 | float | Shown as byte |
go_memstats_heap_objects | 分配的对象数。 | float | Shown as object |
go_memstats_heap_released_bytes | 最后一次GC返还给操作系统的堆字节数。 | float | Shown as byte |
go_memstats_heap_sys_bytes | 系统分配的堆字节数。 | float | Shown as byte |
go_memstats_last_gc_time_seconds | GC持续时长。 | float | Shown as second |
go_memstats_lookups_total | lookups总数。 | float | Shown as operation |
go_memstats_mallocs_total | mallocs总数。 | float | Shown as operation |
go_memstats_mcache_inuse_bytes | mcache正在使用的字节数。 | float | Shown as byte |
go_memstats_mcache_sys_bytes | 系统分配的用于mcache的字节数。 | float | Shown as byte |
go_memstats_mspan_inuse_bytes | mspan使用的字节数。 | float | Shown as byte |
go_memstats_mspan_sys_bytes | 系统分配的用于mspan的字节数。 | float | Shown as byte |
go_memstats_next_gc_bytes | 下次进行GC时将被回收的堆区字节数。 | float | Shown as byte |
go_memstats_other_sys_bytes | 用于其他系统分配的字节数。 | float | Shown as byte |
go_memstats_stack_inuse_bytes | 已使用的堆栈区字节数。 | float | Shown as byte |
go_memstats_stack_sys_bytes | 系统分配的堆栈区字节数。 | float | Shown as byte |
go_memstats_sys_bytes | 系统分配的字节数。 | float | Shown as byte |
go_threads | 操作系统创建的线程数。 | float | Shown as thread |
process_cpu_seconds_total | 进程在用户态和内核态花费的总时间(以秒为单位)。 | float | Shown as second |
process_max_fds | 打开文件描述符的最大数量。 | float | Shown as file |
process_open_fds | 打开文件描述符的数量。 | float | Shown as file |
process_resident_memory_bytes | 进程所使用的的内存大小。 | float | Shown as byte |
process_start_time_seconds | 进程启动时的Unix时间戳 | float | Shown as second |
process_virtual_memory_bytes | 虚拟内存字节数。 | float | Shown as byte |
process_virtual_memory_max_bytes | 虚拟内存最大字节数。 | float | Shown as byte |