ZBLOG

prometheus监控greenplum实现CPU、内存、磁盘、网络、连接数、查询数、缓存命中率等监控告警规则

以下是一些可能有用的Prometheus监控和告警规则,可以在监控Greenplum时使用:

CPU 监控:

# CPU usage percentage
100 - (avg by(instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)

内存 监控:

# Memory usage percentage
100 - ((node_memory_MemFree + node_memory_Buffers + node_memory_Cached) / node_memory_MemTotal * 100)

磁盘 监控:

# Disk usage percentage
100 - ((node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"}) * 100)

网络 监控:

# Network traffic in bytes/s
sum(increase(node_network_receive_bytes_total[1m])) + sum(increase(node_network_transmit_bytes_total[1m]))

连接数 监控:

# Number of TCP connections
count(netstat_sockets{protocol="tcp"})

查询数 监控:

# Number of queries executed per second
rate(gp_interconnect_query_sent[1m])

缓存命中率 监控:

# Cache hit rate
((gp_segment_configuration_table_scan_count - gp_segment_configuration_table_scan_disk_count) / gp_segment_configuration_table_scan_count) * 100

这些规则可以产生警报,例如当磁盘使用率超过90%时:

ALERT DiskUsageCritical
  IF (node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"}) * 100 < 10
  FOR 5m
  LABELS { severity="critical" }
  ANNOTATIONS {
    summary = "Disk usage is too high",
    description = "The disk usage on {{ $labels.instance }} has reached critical levels.",
  }

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=2260

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?