test.yaml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. rule_files:
  2. - mixin.yaml
  3. evaluation_interval: 1m
  4. tests:
  5. - interval: 1m
  6. input_series:
  7. - series: 'up{job="etcd",instance="10.10.10.0"}'
  8. values: '1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0'
  9. - series: 'up{job="etcd",instance="10.10.10.1"}'
  10. values: '1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0'
  11. - series: 'up{job="etcd",instance="10.10.10.2"}'
  12. values: '1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0'
  13. alert_rule_test:
  14. - eval_time: 3m
  15. alertname: etcdInsufficientMembers
  16. - eval_time: 5m
  17. alertname: etcdInsufficientMembers
  18. - eval_time: 5m
  19. alertname: etcdMembersDown
  20. - eval_time: 7m
  21. alertname: etcdMembersDown
  22. exp_alerts:
  23. - exp_labels:
  24. job: etcd
  25. severity: critical
  26. exp_annotations:
  27. message: 'etcd cluster "etcd": members are down (1).'
  28. - eval_time: 7m
  29. alertname: etcdInsufficientMembers
  30. - eval_time: 11m
  31. alertname: etcdInsufficientMembers
  32. exp_alerts:
  33. - exp_labels:
  34. job: etcd
  35. severity: critical
  36. exp_annotations:
  37. message: 'etcd cluster "etcd": insufficient members (1).'
  38. - eval_time: 15m
  39. alertname: etcdInsufficientMembers
  40. exp_alerts:
  41. - exp_labels:
  42. job: etcd
  43. severity: critical
  44. exp_annotations:
  45. message: 'etcd cluster "etcd": insufficient members (0).'
  46. - interval: 1m
  47. input_series:
  48. - series: 'up{job="etcd",instance="10.10.10.0"}'
  49. values: '1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0'
  50. - series: 'up{job="etcd",instance="10.10.10.1"}'
  51. values: '1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0'
  52. - series: 'up{job="etcd",instance="10.10.10.2"}'
  53. values: '1 1 1 1 0 0 0 0'
  54. alert_rule_test:
  55. - eval_time: 10m
  56. alertname: etcdMembersDown
  57. exp_alerts:
  58. - exp_labels:
  59. job: etcd
  60. severity: critical
  61. exp_annotations:
  62. message: 'etcd cluster "etcd": members are down (2).'
  63. - interval: 1m
  64. input_series:
  65. - series: 'up{job="etcd",instance="10.10.10.0"}'
  66. values: '1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0'
  67. - series: 'up{job="etcd",instance="10.10.10.1"}'
  68. values: '1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0'
  69. - series: 'etcd_network_peer_sent_failures_total{To="member-1",job="etcd",endpoint="test"}'
  70. values: '0 0 1 2 3 4 5 6 7 8 9 10'
  71. alert_rule_test:
  72. - eval_time: 4m
  73. alertname: etcdMembersDown
  74. - eval_time: 6m
  75. alertname: etcdMembersDown
  76. exp_alerts:
  77. - exp_labels:
  78. job: etcd
  79. severity: critical
  80. exp_annotations:
  81. message: 'etcd cluster "etcd": members are down (1).'