mirror of
https://github.com/labring/sealos.git
synced 2026-09-19 10:54:42 +08:00
add kafka monitor (#4349)
This commit is contained in:
@@ -118,4 +118,12 @@ var (
|
||||
"minio_bucket_traffic_received_bytes": "sum(minio_bucket_traffic_received_bytes{bucket=\"@\"}) by (bucket, instance, job, namespace)",
|
||||
"minio_bucket_traffic_sent_bytes": "sum(minio_bucket_traffic_sent_bytes{bucket=\"@\"}) by (bucket, instance, job, namespace)",
|
||||
}
|
||||
|
||||
Kafka = map[string]string{
|
||||
"cpu": "round(max by (pod) (rate(container_cpu_usage_seconds_total{namespace=~\"#\",pod=~\"@-kafka-\\\\d\" ,container=\"kafka\"}[5m])) / on (pod) (max by (pod) (container_spec_cpu_quota{namespace=~\"#\", pod=~\"@-kafka-\\\\d\",container=\"kafka\"} / 100000)) * 100,0.01)",
|
||||
"memory": "round(max by (pod)(container_memory_usage_bytes{namespace=~\"#\",pod=~\"@-kafka-\\\\d\",container=\"kafka\" })/ on (pod) (max by (pod) (container_spec_memory_limit_bytes{namespace=~\"#\", pod=~\"@-kafka-\\\\d\",container=\"kafka\"})) * 100,0.01)",
|
||||
"disk_capacity": "(max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_capacity_bytes {namespace=~\"#\", persistentvolumeclaim=~\"data-@-kafka-\\\\d\"}))",
|
||||
"disk": "round((max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes {namespace=~\"#\", persistentvolumeclaim=~\"data-@-kafka-\\\\d\"})) / (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_capacity_bytes {namespace=~\"#\", persistentvolumeclaim=~\"data-@-kafka-\\\\d\"})) * 100, 0.01)",
|
||||
"disk_used": "(max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes {namespace=~\"#\", persistentvolumeclaim=~\"data-@-kafka-\\\\d\"}))",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -77,6 +77,8 @@ func GetQuery(query *api.PromRequest) (string, error) {
|
||||
result = api.Pgsql[query.Query]
|
||||
case "minio":
|
||||
result = api.Minio[query.Query]
|
||||
case "kafka":
|
||||
result = api.Kafka[query.Query]
|
||||
default:
|
||||
fmt.Println(query.Type)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user