django.rules 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. groups:
  2. - name: django.rules
  3. rules:
  4. - record: job:django_http_requests_before_middlewares_total:sum_rate30s
  5. expr: sum(rate(django_http_requests_before_middlewares_total[30s])) BY (job)
  6. - record: job:django_http_requests_unknown_latency_total:sum_rate30s
  7. expr: sum(rate(django_http_requests_unknown_latency_total[30s])) BY (job)
  8. - record: job:django_http_ajax_requests_total:sum_rate30s
  9. expr: sum(rate(django_http_ajax_requests_total[30s])) BY (job)
  10. - record: job:django_http_responses_before_middlewares_total:sum_rate30s
  11. expr: sum(rate(django_http_responses_before_middlewares_total[30s])) BY (job)
  12. - record: job:django_http_requests_unknown_latency_including_middlewares_total:sum_rate30s
  13. expr: sum(rate(django_http_requests_unknown_latency_including_middlewares_total[30s]))
  14. BY (job)
  15. - record: job:django_http_requests_body_total_bytes:sum_rate30s
  16. expr: sum(rate(django_http_requests_body_total_bytes[30s])) BY (job)
  17. - record: job:django_http_responses_streaming_total:sum_rate30s
  18. expr: sum(rate(django_http_responses_streaming_total[30s])) BY (job)
  19. - record: job:django_http_responses_body_total_bytes:sum_rate30s
  20. expr: sum(rate(django_http_responses_body_total_bytes[30s])) BY (job)
  21. - record: job:django_http_requests_total:sum_rate30s
  22. expr: sum(rate(django_http_requests_total_by_method[30s])) BY (job)
  23. - record: job:django_http_requests_total_by_method:sum_rate30s
  24. expr: sum(rate(django_http_requests_total_by_method[30s])) BY (job, method)
  25. - record: job:django_http_requests_total_by_transport:sum_rate30s
  26. expr: sum(rate(django_http_requests_total_by_transport[30s])) BY (job, transport)
  27. - record: job:django_http_requests_total_by_view:sum_rate30s
  28. expr: sum(rate(django_http_requests_total_by_view_transport_method[30s])) BY (job,
  29. view)
  30. - record: job:django_http_requests_total_by_view_transport_method:sum_rate30s
  31. expr: sum(rate(django_http_requests_total_by_view_transport_method[30s])) BY (job,
  32. view, transport, method)
  33. - record: job:django_http_responses_total_by_templatename:sum_rate30s
  34. expr: sum(rate(django_http_responses_total_by_templatename[30s])) BY (job, templatename)
  35. - record: job:django_http_responses_total_by_status:sum_rate30s
  36. expr: sum(rate(django_http_responses_total_by_status[30s])) BY (job, status)
  37. - record: job:django_http_responses_total_by_status_name_method:sum_rate30s
  38. expr: sum(rate(django_http_responses_total_by_status_name_method[30s])) BY (job,
  39. status, name, method)
  40. - record: job:django_http_responses_total_by_charset:sum_rate30s
  41. expr: sum(rate(django_http_responses_total_by_charset[30s])) BY (job, charset)
  42. - record: job:django_http_exceptions_total_by_type:sum_rate30s
  43. expr: sum(rate(django_http_exceptions_total_by_type[30s])) BY (job, type)
  44. - record: job:django_http_exceptions_total_by_view:sum_rate30s
  45. expr: sum(rate(django_http_exceptions_total_by_view[30s])) BY (job, view)
  46. - record: job:django_http_requests_latency_including_middlewares_seconds:quantile_rate30s
  47. expr: histogram_quantile(0.5, sum(rate(django_http_requests_latency_including_middlewares_seconds_bucket[30s]))
  48. BY (job, le))
  49. labels:
  50. quantile: "50"
  51. - record: job:django_http_requests_latency_including_middlewares_seconds:quantile_rate30s
  52. expr: histogram_quantile(0.95, sum(rate(django_http_requests_latency_including_middlewares_seconds_bucket[30s]))
  53. BY (job, le))
  54. labels:
  55. quantile: "95"
  56. - record: job:django_http_requests_latency_including_middlewares_seconds:quantile_rate30s
  57. expr: histogram_quantile(0.99, sum(rate(django_http_requests_latency_including_middlewares_seconds_bucket[30s]))
  58. BY (job, le))
  59. labels:
  60. quantile: "99"
  61. - record: job:django_http_requests_latency_including_middlewares_seconds:quantile_rate30s
  62. expr: histogram_quantile(0.999, sum(rate(django_http_requests_latency_including_middlewares_seconds_bucket[30s]))
  63. BY (job, le))
  64. labels:
  65. quantile: "99.9"
  66. - record: job:django_http_requests_latency_seconds:quantile_rate30s
  67. expr: histogram_quantile(0.5, sum(rate(django_http_requests_latency_seconds_bucket[30s]))
  68. BY (job, le))
  69. labels:
  70. quantile: "50"
  71. - record: job:django_http_requests_latency_seconds:quantile_rate30s
  72. expr: histogram_quantile(0.95, sum(rate(django_http_requests_latency_seconds_bucket[30s]))
  73. BY (job, le))
  74. labels:
  75. quantile: "95"
  76. - record: job:django_http_requests_latency_seconds:quantile_rate30s
  77. expr: histogram_quantile(0.99, sum(rate(django_http_requests_latency_seconds_bucket[30s]))
  78. BY (job, le))
  79. labels:
  80. quantile: "99"
  81. - record: job:django_http_requests_latency_seconds:quantile_rate30s
  82. expr: histogram_quantile(0.999, sum(rate(django_http_requests_latency_seconds_bucket[30s]))
  83. BY (job, le))
  84. labels:
  85. quantile: "99.9"
  86. - record: job:django_model_inserts_total:sum_rate1m
  87. expr: sum(rate(django_model_inserts_total[1m])) BY (job, model)
  88. - record: job:django_model_updates_total:sum_rate1m
  89. expr: sum(rate(django_model_updates_total[1m])) BY (job, model)
  90. - record: job:django_model_deletes_total:sum_rate1m
  91. expr: sum(rate(django_model_deletes_total[1m])) BY (job, model)
  92. - record: job:django_db_new_connections_total:sum_rate30s
  93. expr: sum(rate(django_db_new_connections_total[30s])) BY (alias, vendor)
  94. - record: job:django_db_new_connection_errors_total:sum_rate30s
  95. expr: sum(rate(django_db_new_connection_errors_total[30s])) BY (alias, vendor)
  96. - record: job:django_db_execute_total:sum_rate30s
  97. expr: sum(rate(django_db_execute_total[30s])) BY (alias, vendor)
  98. - record: job:django_db_execute_many_total:sum_rate30s
  99. expr: sum(rate(django_db_execute_many_total[30s])) BY (alias, vendor)
  100. - record: job:django_db_errors_total:sum_rate30s
  101. expr: sum(rate(django_db_errors_total[30s])) BY (alias, vendor, type)
  102. - record: job:django_migrations_applied_total:max
  103. expr: max(django_migrations_applied_total) BY (job, connection)
  104. - record: job:django_migrations_unapplied_total:max
  105. expr: max(django_migrations_unapplied_total) BY (job, connection)