etcd3_alert.rules 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # general cluster availability
  2. # alert if another failed member will result in an unavailable cluster
  3. ALERT InsufficientMembers
  4. IF count(up{job="etcd"} == 0) > (count(up{job="etcd"}) / 2 - 1)
  5. FOR 3m
  6. LABELS {
  7. severity = "critical"
  8. }
  9. ANNOTATIONS {
  10. summary = "etcd cluster insufficient members",
  11. description = "If one more etcd member goes down the cluster will be unavailable",
  12. }
  13. # etcd leader alerts
  14. # ==================
  15. # alert if any etcd instance has no leader
  16. ALERT NoLeader
  17. IF etcd_server_has_leader{job="etcd"} == 0
  18. FOR 1m
  19. LABELS {
  20. severity = "critical"
  21. }
  22. ANNOTATIONS {
  23. summary = "etcd member has no leader",
  24. description = "etcd member {{ $labels.instance }} has no leader",
  25. }
  26. # alert if there are lots of leader changes
  27. ALERT HighNumberOfLeaderChanges
  28. IF increase(etcd_server_leader_changes_seen_total{job="etcd"}[1h]) > 3
  29. LABELS {
  30. severity = "warning"
  31. }
  32. ANNOTATIONS {
  33. summary = "a high number of leader changes within the etcd cluster are happening",
  34. description = "etcd instance {{ $labels.instance }} has seen {{ $value }} leader changes within the last hour",
  35. }
  36. # gRPC request alerts
  37. # ===================
  38. # alert if more than 1% of gRPC method calls have failed within the last 5 minutes
  39. ALERT HighNumberOfFailedGRPCRequests
  40. IF 100 * (sum by(grpc_method) (rate(etcd_grpc_requests_failed_total{job="etcd"}[5m]))
  41. / sum by(grpc_method) (rate(etcd_grpc_total{job="etcd"}[5m]))) > 1
  42. FOR 10m
  43. LABELS {
  44. severity = "warning"
  45. }
  46. ANNOTATIONS {
  47. summary = "a high number of gRPC requests are failing",
  48. description = "{{ $value }}% of requests for {{ $labels.grpc_method }} failed on etcd instance {{ $labels.instance }}",
  49. }
  50. # alert if more than 5% of gRPC method calls have failed within the last 5 minutes
  51. ALERT HighNumberOfFailedGRPCRequests
  52. IF 100 * (sum by(grpc_method) (rate(etcd_grpc_requests_failed_total{job="etcd"}[5m]))
  53. / sum by(grpc_method) (rate(etcd_grpc_total{job="etcd"}[5m]))) > 5
  54. FOR 5m
  55. LABELS {
  56. severity = "critical"
  57. }
  58. ANNOTATIONS {
  59. summary = "a high number of gRPC requests are failing",
  60. description = "{{ $value }}% of requests for {{ $labels.grpc_method }} failed on etcd instance {{ $labels.instance }}",
  61. }
  62. # alert if the 99th percentile of gRPC method calls take more than 150ms
  63. ALERT GRPCRequestsSlow
  64. IF histogram_quantile(0.99, sum(rate(grpc_server_handling_seconds_bucket{job="etcd",grpc_type="unary"}[5m])) by (grpc_service, grpc_method, le)) > 0.15
  65. FOR 10m
  66. LABELS {
  67. severity = "critical"
  68. }
  69. ANNOTATIONS {
  70. summary = "slow gRPC requests",
  71. description = "on etcd instance {{ $labels.instance }} gRPC requests to {{ $labels.grpc_method }} are slow",
  72. }
  73. # file descriptor alerts
  74. # ======================
  75. instance:fd_utilization = process_open_fds / process_max_fds
  76. # alert if file descriptors are likely to exhaust within the next 4 hours
  77. ALERT FdExhaustionClose
  78. IF predict_linear(instance:fd_utilization[1h], 3600 * 4) > 1
  79. FOR 10m
  80. LABELS {
  81. severity = "warning"
  82. }
  83. ANNOTATIONS {
  84. summary = "file descriptors soon exhausted",
  85. description = "{{ $labels.job }} instance {{ $labels.instance }} will exhaust its file descriptors soon",
  86. }
  87. # alert if file descriptors are likely to exhaust within the next hour
  88. ALERT FdExhaustionClose
  89. IF predict_linear(instance:fd_utilization[10m], 3600) > 1
  90. FOR 10m
  91. LABELS {
  92. severity = "critical"
  93. }
  94. ANNOTATIONS {
  95. summary = "file descriptors soon exhausted",
  96. description = "{{ $labels.job }} instance {{ $labels.instance }} will exhaust its file descriptors soon",
  97. }
  98. # etcd member communication alerts
  99. # ================================
  100. # alert if 99th percentile of round trips take 150ms
  101. ALERT EtcdMemberCommunicationSlow
  102. IF histogram_quantile(0.99, rate(etcd_network_peer_round_trip_time_seconds_bucket[5m])) > 0.15
  103. FOR 10m
  104. LABELS {
  105. severity = "warning"
  106. }
  107. ANNOTATIONS {
  108. summary = "etcd member communication is slow",
  109. description = "etcd instance {{ $labels.instance }} member communication with {{ $labels.To }} is slow",
  110. }
  111. # etcd proposal alerts
  112. # ====================
  113. # alert if there are several failed proposals within an hour
  114. ALERT HighNumberOfFailedProposals
  115. IF increase(etcd_server_proposals_failed_total{job="etcd"}[1h]) > 5
  116. LABELS {
  117. severity = "warning"
  118. }
  119. ANNOTATIONS {
  120. summary = "a high number of proposals within the etcd cluster are failing",
  121. description = "etcd instance {{ $labels.instance }} has seen {{ $value }} proposal failures within the last hour",
  122. }
  123. # etcd disk io latency alerts
  124. # ===========================
  125. # alert if 99th percentile of fsync durations is higher than 500ms
  126. ALERT HighFsyncDurations
  127. IF histogram_quantile(0.99, rate(etcd_disk_wal_fsync_duration_seconds_bucket[5m])) > 0.5
  128. FOR 10m
  129. LABELS {
  130. severity = "warning"
  131. }
  132. ANNOTATIONS {
  133. summary = "high fsync durations",
  134. description = "etcd instance {{ $labels.instance }} fync durations are high",
  135. }
  136. # alert if 99th percentile of commit durations is higher than 250ms
  137. ALERT HighCommitDurations
  138. IF histogram_quantile(0.99, rate(etcd_disk_backend_commit_duration_seconds_bucket[5m])) > 0.25
  139. FOR 10m
  140. LABELS {
  141. severity = "warning"
  142. }
  143. ANNOTATIONS {
  144. summary = "high commit durations",
  145. description = "etcd instance {{ $labels.instance }} commit durations are high",
  146. }