0%

Prometheus monitoring/kubelet监控指标

通过kube-prometheus安装的k8s监控系统。

在targets页面,我们来分析一下monitoring/kubelet/的两个Targets。

prometheus-serviceMonitorKubelet.yaml内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
k8s-app: kubelet
name: kubelet
namespace: monitoring
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true
interval: 30s
port: https-metrics
scheme: https
tlsConfig:
insecureSkipVerify: true
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true
interval: 30s
metricRelabelings:
- action: drop
regex: container_(network_tcp_usage_total|network_udp_usage_total|tasks_state|cpu_load_average_10s)
sourceLabels:
- __name__
path: /metrics/cadvisor
port: https-metrics
scheme: https
tlsConfig:
insecureSkipVerify: true
jobLabel: k8s-app
namespaceSelector:
matchNames:
- kube-system
selector:
matchLabels:
k8s-app: kubelet

monitoring/kubelet/0

Endpoint: https://172.16.64.232:10250/metrics

指标以kubelet_开始
apiserver_
http_request_
http_request_
rest_client_request_
storage_operation_
volume_manager_

指标kubelet-0-0.txt 点击查看

monitoring/kubelet/1

Endpoint: https://172.16.64.232:10250/metrics/cadvisor

使用的自动发现role为endpoints

1
2
3
4
5
6
7
8
9
- job_name: monitoring/kubelet/1
honor_labels: true
honor_timestamps: true
scrape_interval: 30s
scrape_timeout: 10s
metrics_path: /metrics/cadvisor
scheme: https
kubernetes_sd_configs:
- role: endpoints

包含一个cadvisor_version_info指标可以查看cadvisor的版本信息。
其他指标以container_开始

指标kubelet-1-0.txt 点击查看