本文主要对coredns的prometheus监控进行介绍,以及对grafana中配置coredns的dashboard进行分享。
0、背景
Prometheus插件作为coredns的Plugins,默认情况下是内置在coredns中,如果是自己编译安装的版本,需要注意在编译安装的时候的plugin.cfg
文件中添加了prometheus:metrics
,这样才能确保编译成功。
# 首先我们检查一下运行的版本
[root@tiny-server coredns]# ./coredns -plugins | grep prometheus
dns.prometheus
1、简介
prometheus 插件主要用于暴露CoreDNS相关的监控数据,除了coredns本身外,其他支持prometheus的插件(如cache插件)在启用的时候也可以通过prometheus插件暴露出相关的监控信息,默认情况下暴露出的监控数据在localhost:9153
,路径为/metrics
,**配置文件中的每个server块只能使用一次prometheus<