1. 程式人生 > 其它 >kubelet 指標監控,/metrics 介面暴露出來的指標列表和說明,

kubelet 指標監控,/metrics 介面暴露出來的指標列表和說明,

技術標籤:kubernetesk8skubeletkubernetes指標監控

現狀

這段時間在研究 kubernetes 的效能測試,需要觀察當前 kubernetes 的各種執行指標,但是苦於英語渣,百度又找不到別人的分享,或者搜尋詞不對。

過程

沒有辦法,硬著頭皮使用 Goole 翻譯加上看程式碼對 kubelet 的指標內容進行了翻譯,所以整理一下,希望可以幫到有需要的人。

結果

// 審計事件生成併發送到審計後端的數量
# HELP apiserver_audit_event_total [ALPHA] Counter of audit events generated and sent to the audit backend.

// apiserver 請求由於審計日誌後端發生錯誤而被拒絕的數量
# HELP apiserver_audit_requests_rejected_total [ALPHA] Counter of apiserver requests rejected due to an error in audit logging backend.

// 驗證請求使用的證書的剩餘時間的分佈情況
# HELP apiserver_client_certificate_expiration_seconds [ALPHA] Distribution of the remaining lifetime on the certificate used to authenticate a request.

// 用於快取 DEK 而使用掉的快取百分比
# HELP apiserver_envelope_encryption_dek_cache_fill_percent [ALPHA] Percent of the cache slots currently occupied by cached DEKs.

// 生成加密key的操作耗時,以秒為單位
# HELP apiserver_storage_data_key_generation_duration_seconds [ALPHA] Latencies in seconds of data encryption key(DEK) generation operations.

// 生成加密key失敗的數量
# HELP apiserver_storage_data_key_generation_failures_total [ALPHA] Total number of failed data encryption key(DEK) generation operations.

// 訪問解密key時沒有命中快取的總數
# HELP apiserver_storage_envelope_transformation_cache_misses_total [ALPHA] Total number of cache misses while accessing key decryption key(KEK).

// 記錄了Token()方法請求備用令牌源的次數
# HELP get_token_count [ALPHA] Counter of total Token() requests to the alternate token source 

// 記錄了Token()方法請求備用令牌源失敗的次數
# HELP get_token_fail_count [ALPHA] Counter of failed Token() requests to the alternate token source 

// 記錄了 pod 擁有的 container 容器數量
# HELP kubelet_containers_per_pod_count [ALPHA] The number of containers per pod.

// 正在或者已經發送出去請求,正在等待伺服器響應中的請求數量
# HELP kubelet_http_inflight_requests [ALPHA] Number of the inflight http requests 

// HTTP請求的響應時間,以秒為單位
# HELP kubelet_http_requests_duration_seconds [ALPHA] Duration in seconds to serve http requests 

// 伺服器啟動以來接收到的請求數量
# HELP kubelet_http_requests_total [ALPHA] Number of the http requests received since the server started 

// 如果節點遇到與配置相關的錯誤,會把指標設定為true(1),否則為false(0)。
# HELP kubelet_node_config_error [ALPHA] This metric is true (1) if the node is experiencing a configuration-related error, false (0) otherwise.

// node節點名稱,這裡的數量始終為1個
# HELP kubelet_node_name [ALPHA] The node's name. The count is always 1. 

// 丟棄掉的 PLEG 事件數量 - 一般是由於事件佇列滿了
# HELP kubelet_pleg_discard_events [ALPHA] The number of discard events in PLEG. 

// PLEG 最後一次可用(實際上是健康檢查)的秒級時間戳 
# HELP kubelet_pleg_last_seen_seconds [ALPHA] Timestamp in seconds when PLEG was last seen active. 

// PLEG 進行 relist 操作的響應時間 - relist() 操作會向執行時獲取pod/容器列表然後和內部的列表進行比較,並生成相應的事件
# HELP kubelet_pleg_relist_duration_seconds [ALPHA] Duration in seconds for relisting pods in PLEG. 

// PLEG 兩次 relist 操作之間的間隔時間
# HELP kubelet_pleg_relist_interval_seconds [ALPHA] Interval in seconds between relisting in PLEG. 

// 單個 pod 從pending狀態到running狀態花費的時間,以秒為單位。
# HELP kubelet_pod_start_duration_seconds [ALPHA] Duration in seconds for a single pod to go from pending to running. 

// 從看到一個pod(pod存在?相似但不完全一樣)到開始工作(starting a worker)花費的時間,以秒為單位.
# HELP kubelet_pod_worker_start_duration_seconds [ALPHA] Duration in seconds from seeing a pod to starting a worker. 

// 當前正在執行中的pod數量
# HELP kubelet_running_pods [ALPHA] Number of pods currently running 

// runtime操作的響應時間,按操作型別劃分,以秒為單位
# HELP kubelet_runtime_operations_duration_seconds [ALPHA] Duration in seconds of runtime operations. Broken down by operation type. 

// 累計的runtime運算元量,按操作型別劃分。
# HELP kubelet_runtime_operations_total [ALPHA] Cumulative number of runtime operations by operation type. 

// 編譯資訊
# HELP kubernetes_build_info [ALPHA] A metric with a constant '1' value labeled by major, minor, git version, git commit, git tree state, build date, Go version, and compiler from which Kubernetes was built, and platform on which it is running.

// 執行輪換之前最後一個 auth 外掛生成的客戶端證書的生存時間,秒為單位。如果沒有使用外掛或者外掛不管理證書,這裡沒資料。
# HELP rest_client_exec_plugin_certificate_rotation_age [ALPHA] Histogram of the number of seconds the last auth exec plugin client certificate lived before being rotated. If auth exec plugin client certificates are unused, histogram will contain no data.

// 由 auth  外掛管理的客戶端證書最短生存時間,以秒為單位,證書過期則為負數。如果沒有使用外掛或者外掛不管理證書,則該值為+INF
# HELP rest_client_exec_plugin_ttl_seconds [ALPHA] Gauge of the shortest TTL (time-to-live) of the client certificate(s) managed by the auth exec plugin. The value is in seconds until certificate expiry (negative if already expired). If auth exec plugins are unused or manage no TLS certificates, the value will be +INF.

// 請求的延時時間,按URL和動作(varb)劃分。
# HELP rest_client_request_duration_seconds [ALPHA] Request latency in seconds. Broken down by verb and URL. 

// HTTP請求數量,按伺服器響應程式碼,操作方式和host進行劃分.
# HELP rest_client_requests_total [ALPHA] Number of HTTP requests, partitioned by status code, method, and host.