Understanding Processes Running on Linux Host with Percona Monitoring and Management - Percona Database Performance Bloghttps://www.percona.com/blog/2021/04/22/understanding-processes-running-on-linux-host-with-percona-monitoring-and-management/?
部署process-exporter
GitHub - ncabatoff/process-exporter: Prometheus exporter that mines /proc to report on selected processes
配置文件
监控所有进程
process_names:
- name: "{{.Comm}}"
cmdline:
- '.+'
docker部署
docker run -d --name process-exporter --network host --privileged -v /proc:/host/proc -v `pwd`/config:/config ncabatoff/process-exporter:0.7.10 --procfs /host/proc -config.path /config/process-exporter.yaml
给process-exporter配置servicemonitor
按需替换Endpoints中的ip
apiVersion: v1
kind: Service
metadata:
name: xxx-process
namespace: xxx-system
spec:
clusterIP: None
ports:
- name: xxx-process
port: 9256
protocol: TCP
targetPort: 9256
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
---
apiVersion: v1
kind: Endpoints
metadata:
name: xxx-process
namespace: xxx-system
subsets:
- addresses:
- ip: 10.10.13.200
ports:
- name: xxx-process
port: 9256
protocol: TCP
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: xxx-process
namespace: xxx-system
spec:
endpoints:
- bearerTokenSecret:
key: ""
interval: 15s
port: xxx-process
jobLabel: xxx-process
namespaceSelector: {}
selector: {}
process-exporter的grafana dashboard
Node Processes [Designed for PMM2] dashboard for Grafana | Grafana Labs
|