1. 程式人生 > 其它 >|NO.Z.00341|——————————|CloudNative|——|KuberNetes&運維.V58|-----------------------------------------------------------|Prometheus.v03|自動發現.v03|檢視監控資料|

|NO.Z.00341|——————————|CloudNative|——|KuberNetes&運維.V58|-----------------------------------------------------------|Prometheus.v03|自動發現.v03|檢視監控資料|



[CloudNative:KuberNetes&運維.V58]                                                                      [Applications.KuberNetes] [|Altermanager|Prometheus自動發現|自動發現監控ratel地址krm.test.com|]








一、檢視建立的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解析








===============================END===============================


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



來自為知筆記(Wiz)