|NO.Z.00341|——————————|CloudNative|——|KuberNetes&运维.V58|——|Prometheus.v03|自动发现.v03|查看监控数据|

一、查看创建的job已经添加完成
### --- 查看discovery是否生成

~~~     ——>http://prom.test.com/——>status
~~~     ——>Service discovery:auto_discovery已经创建完成,但是没有匹配到任何的targets
二、匹配一个域名让其监控
### --- 匹配一个域名让其监控

~~~     ——>http://krm.test.com——>Ingress——>Namespace:kube-system
~~~     ——>Host:krm.test.com——>Option:编辑——>annotations:
~~~     添加:annotations:Key:prometheus.io/http_probe Value:true——>update——>END
~~~     # 若是域名定义了prometheus_io_http_probe这个annotations,
~~~     relabel_configs就可以匹配到,
~~~     若是为true的话,它就会把这个target自动的给监控上,

[root@k8s-master01 discovery]# cat prometheus-additional.yaml
        - source_labels: [__meta_kubernetes_ingress_annotation_prometheus_io_http_probe]
        action: keep
        regex: true
三、检测到targets值,并自动监控上:服务发现检测成功
四、查看grafana是否采集到数据
### --- 查看grafana是否采集到数据

~~~     http://krm.test.com/监控报红:是因为黑盒解析不了域名
~~~     因为这个域名是我们配置了hosts解析

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on 2022-04-01 13:16  yanqi_vip  阅读(27)  评论(0)    收藏  举报

导航