From 68b13aeb50b52c43a34fb7874b590ede35ed3d80 Mon Sep 17 00:00:00 2001 From: Joey Orlando Date: Wed, 5 Jul 2023 20:44:11 +0200 Subject: [PATCH 1/4] slightly tweak django-silk configuration --- engine/settings/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/settings/base.py b/engine/settings/base.py index a7326a6b..5b793d27 100644 --- a/engine/settings/base.py +++ b/engine/settings/base.py @@ -514,9 +514,14 @@ if SILK_PROFILER_ENABLED: SILKY_AUTHENTICATION = True SILKY_AUTHORISATION = True SILKY_PYTHON_PROFILER_BINARY = getenv_boolean("SILKY_PYTHON_PROFILER_BINARY", default=False) - SILKY_MAX_RECORDED_REQUESTS = 10**4 SILKY_PYTHON_PROFILER = True SILKY_IGNORE_PATHS = ["/health/", "/ready/"] + + # see the following GitHub issue comment for why the following two settings are set the way they are + # https://github.com/jazzband/django-silk/issues/265#issuecomment-705482767 + SILKY_MAX_RECORDED_REQUESTS_CHECK_PERCENT = 0.01 + SILKY_MAX_RECORDED_REQUESTS = 100_000 + if "SILKY_PYTHON_PROFILER_RESULT_PATH" in os.environ: SILKY_PYTHON_PROFILER_RESULT_PATH = os.environ.get("SILKY_PYTHON_PROFILER_RESULT_PATH") From 8c8c1fa5fce52a57cf9793761357b8305e586bc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jul 2023 01:22:17 -0400 Subject: [PATCH 2/4] Bump django from 3.2.19 to 3.2.20 in /engine (#2446) Bumps [django](https://github.com/django/django) from 3.2.19 to 3.2.20.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=django&package-manager=pip&previous-version=3.2.19&new-version=3.2.20)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/grafana/oncall/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- engine/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/requirements.txt b/engine/requirements.txt index 3e4e4f22..5baa8a0d 100644 --- a/engine/requirements.txt +++ b/engine/requirements.txt @@ -1,4 +1,4 @@ -django==3.2.19 +django==3.2.20 djangorestframework==3.12.4 slackclient==1.3.0 whitenoise==5.3.0 From 0810d8a9672468984560e2e6bae64516dd5c3946 Mon Sep 17 00:00:00 2001 From: Yulya Artyukhina Date: Thu, 6 Jul 2023 12:38:04 +0200 Subject: [PATCH 3/4] Update oncall metrics dashboard (#2400) # What this PR does - Add new panels to OnCall Metrics dashboard with the new metric "user_was_notified_of_alert_groups" - Remove unused param for dashboard tab from plugin.json - Fix old panels ## Which issue(s) this PR fixes ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --- CHANGELOG.md | 4 + .../dashboards/oncall_metrics_dashboard.json | 403 +++++++++++++++++- grafana-plugin/src/plugin.json | 1 - 3 files changed, 401 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 706e9f15..fa1aaa35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed + +- OnCall Metrics dashboard update ([#2400](https://github.com/grafana/oncall/pull/2400)) + ## v1.3.6 (2023-07-05) ### Fixed diff --git a/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json b/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json index d5e7b0b0..66cac5b0 100644 --- a/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json +++ b/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json @@ -673,7 +673,7 @@ "editorMode": "code", "excludeNullMetadata": false, "exemplar": false, - "expr": "increase(max_over_time(sum by (integration) (avg without(pod, instance) ($alert_groups_total{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\"}))[1h:])[1h:])", + "expr": "increase(max_over_time(sum by (integration) (avg without(pod, instance) ($alert_groups_total{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\"}))[30m:])[1h:])", "fullMetaSearch": false, "instant": false, "legendFormat": "__auto", @@ -1054,9 +1054,368 @@ "x": 0, "y": 55 }, + "id": 38, + "panels": [], + "title": "Notified alert groups by Users (based on all Integrations)", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 80, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 56 + }, + "id": 36, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "disableTextWrap": false, + "editorMode": "code", + "excludeNullMetadata": false, + "exemplar": false, + "expr": "increase(max_over_time(sum by (username) (avg without(pod, instance) ($user_was_notified_of_alert_groups_total{slug=~\"$instance\"}))[30m:])[1h:])", + "fullMetaSearch": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "New alert groups notifications during time period", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "mode": "gradient", + "type": "gauge", + "valueDisplayMode": "color" + }, + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Username" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "auto" + } + }, + { + "id": "custom.width", + "value": 300 + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 66 + }, + "id": 35, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": ["sum"], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.5.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sort_desc(max_over_time(sum by(username) (avg without(pod, instance)($user_was_notified_of_alert_groups_total{slug=~\"$instance\"}))[1d:]))", + "format": "table", + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "New alert groups notifications in total", + "transformations": [ + { + "id": "seriesToRows", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "username": false + }, + "indexByName": {}, + "renameByName": { + "Metric": "Integration", + "Value": "Alert groups", + "team": "Team", + "username": "Username" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "gauge" + }, + "filterable": false, + "inspect": false + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Username" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "auto" + } + }, + { + "id": "custom.width", + "value": 300 + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 66 + }, + "id": 37, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": ["sum"], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.5.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sort_desc(increase(max_over_time(sum by (username) (avg without(pod, instance) ($user_was_notified_of_alert_groups_total{slug=~\"$instance\"}))[1h:])[$__range:]))", + "format": "table", + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "New alert groups notifications for period", + "transformations": [ + { + "id": "seriesToRows", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "username": false + }, + "indexByName": {}, + "renameByName": { + "Metric": "Integration", + "Value": "Alert groups", + "team": "Team", + "username": "Username" + } + } + } + ], + "type": "table" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 77 + }, "id": 12, "panels": [], - "title": "Users data", + "title": "Teams data", "type": "row" }, { @@ -1116,7 +1475,7 @@ "h": 11, "w": 12, "x": 0, - "y": 56 + "y": 78 }, "id": 22, "options": { @@ -1232,7 +1591,7 @@ "h": 11, "w": 12, "x": 12, - "y": 56 + "y": 78 }, "id": 23, "options": { @@ -1313,6 +1672,11 @@ "type": "datasource" }, { + "current": { + "selected": true, + "text": ["oncall_alert_groups_total", "grafanacloud_oncall_instance_alert_groups_total"], + "value": ["oncall_alert_groups_total", "grafanacloud_oncall_instance_alert_groups_total"] + }, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -1321,7 +1685,7 @@ "hide": 2, "includeAll": false, "label": "alert_groups_total", - "multi": false, + "multi": true, "name": "alert_groups_total", "options": [], "query": { @@ -1401,6 +1765,33 @@ "type": "query" }, { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "metrics(user_was_notified_of_alert_groups_total)", + "hide": 2, + "includeAll": false, + "label": "user_was_notified_of_alert_groups_total", + "multi": false, + "name": "user_was_notified_of_alert_groups_total", + "options": [], + "query": { + "query": "metrics(user_was_notified_of_alert_groups_total)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": true, + "text": ["All"], + "value": ["$__all"] + }, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -1488,6 +1879,6 @@ }, "timezone": "browser", "title": "OnCall Metrics", - "version": 0, + "version": 1, "weekStart": "" } diff --git a/grafana-plugin/src/plugin.json b/grafana-plugin/src/plugin.json index efc1196d..183fff3d 100644 --- a/grafana-plugin/src/plugin.json +++ b/grafana-plugin/src/plugin.json @@ -113,7 +113,6 @@ { "type": "dashboard", "path": "dashboards/oncall_metrics_dashboard.json", - "addToNav": true, "name": "OnCall Metrics" } ], From 4ffb595383a6808d3b44cfccbf75594457e8f230 Mon Sep 17 00:00:00 2001 From: Michael Derynck Date: Thu, 6 Jul 2023 11:03:08 -0600 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa1aaa35..f6651ead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## v1.3.7 (2023-07-06) ### Changed