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