日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

【Prometheus 】 Blackbox_exporter 指标 probe_http_duration_seconds

發(fā)布時間:2025/3/20 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Prometheus 】 Blackbox_exporter 指标 probe_http_duration_seconds 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Prometheus 之 Blackbox_exporter 黑盒測試

probe_http_duration_seconds phase 值的解析
- resolve:DNS解析持續(xù)時間 - connect:TCP連接建立的持續(xù)時間 - tls: TLS連接協(xié)商持續(xù)時間(我認(rèn)為這包括TCP連接建立持續(xù)時間) - processing:建立連接與接收響應(yīng)的第一個字節(jié)之間的持續(xù)時間 - transfer:轉(zhuǎn)移響應(yīng)的持續(xù)時間
  • resolve: DNS resolution duration
  • connect: TCP connection establishment duration
  • tls: TLS connection negotiation duration (I think this includes TCP connection establishment duration)
  • processing: Duration between having established a connection and receiving the first byte of the response
  • transfer: Duration for transferring the response

ICMP探針需要提升的特權(quán)才能運(yùn)行:

  • Windows:需要管理員權(quán)限。
  • Linux:需要root用戶 或 CAP_NET_RAW 功能。
    • 可以通過執(zhí)行設(shè)置 setcap cap_net_raw+ep blackbox_exporter
  • BSD / OS X:需要root用戶。

詳細(xì)解釋 prometheus job config 內(nèi)容

- job_name: 'http'metrics_path: /probeparams:module: [http_2xx]static_configs:- targets: - 120.52.137.xxx:81- xxxxxx:123relabel_configs:- source_labels: [__address__]target_label: __param_target- source_labels: [__param_target]target_label: instance- target_label: __address__replacement: black-exporter:9115

params聲明的參數(shù)將會是發(fā)送到黑盒的http接口當(dāng)作參數(shù),
向black-exporter:9115 的web路由/probe發(fā)送參數(shù)包含module和探測的target.
所以我們可以用curl模擬http(prometheus拉取metrics也是發(fā)同樣的http請求)請求能看到metrics信息輸出,
下面是一個curl獲取黑盒監(jiān)控使用ping模塊去檢測192.168.1返回的metrics的例子

$ curl "http://127.0.0.1:9115/probe?module=ping&target=192.168.1.2" # HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds # TYPE probe_dns_lookup_time_seconds gauge probe_dns_lookup_time_seconds 2.6453e-05 # HELP probe_duration_seconds Returns how long the probe took to complete in seconds # TYPE probe_duration_seconds gauge probe_duration_seconds 0.000351649 # HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6 # TYPE probe_ip_protocol gauge probe_ip_protocol 4 # HELP probe_success Displays whether or not the probe was a success # TYPE probe_success gauge probe_success 1 relabel_configs: 第1步,獲取targets的實例address值寫進(jìn)__param_target, __param_<name>形式的標(biāo)簽里的name和它的值會被添加到發(fā)送到黑盒的http的header的params當(dāng)作鍵值,例如__param_module對應(yīng)params里的module 第2步,獲取__param_target的值,并覆寫到instance標(biāo)簽中 第3步,覆寫Target實例的__address__標(biāo)簽值為BlockBox Exporter實例的訪問地址 第4部,向black-exporter:9115 發(fā)送請求獲取實例的metrics信息

總結(jié)

以上是生活随笔為你收集整理的【Prometheus 】 Blackbox_exporter 指标 probe_http_duration_seconds的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。