You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.rst
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,23 @@ Change Log
14
14
Unreleased
15
15
----------
16
16
17
+
[4.0.0] = 2021-04-30
18
+
19
+
Removed
20
+
-------
21
+
22
+
* Removed the old location of ``CodeOwnerMonitoringMiddleware``. It had moved in a past commit. Although technically a breaking change, all references in the Open edX platform have already been updated to point to the new location.
23
+
24
+
Added
25
+
-----
26
+
27
+
* Added new ``code_owner_theme`` and ``code_owner_squad`` custom attributes. This is useful in cases where the ``code_owner`` combines a theme and squad name, because monitoring can instead reference ``code_owner_squad`` to be resilient to theme name updates. For the decision doc, see edx_django_utils/monitoring/docs/decisions/0004-code-owner-theme-and-squad.rst.
28
+
29
+
Updated
30
+
-------
31
+
32
+
* Misconfigurations of CODE_OWNER_MAPPINGS will now fail fast, rather than just logging. Although technically a breaking change, if CODE_OWNER_MAPPINGS is in use, it is probably correctly configured and this change should be a no-op.
As detailed in the `Monitoring by Code Owner ADR`_, we added a ``code_owner`` custom attribute for monitoring by code owner. The value for this attribute had the format 'theme-squad'.
13
+
14
+
The problems with this configuration is that for theme name changes, or when squads transfer themes, any monitoring referencing the full name would also need to be updated.
15
+
16
+
.. _Monitoring by Code Owner ADR: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/monitoring/docs/decisions/0001-monitoring-by-code-owner.rst
17
+
18
+
Decision
19
+
--------
20
+
21
+
We will add a ``code_owner_squad`` custom attribute. Monitoring will now be able to refer to ``code_owner_squad`` with a value of 'squad', and will be unaffected by theme name changes.
22
+
23
+
Additionally, we are adding ``code_owner_theme`` for similar convenience if there is a need for theme-based monitoring.
24
+
25
+
We will leave the original ``code_owner`` custom attribute for backward compatability, and for cases where theme and squad are not used.
26
+
27
+
Consequences
28
+
------------
29
+
30
+
* Theme name changes may now result in a one time fix for those that were relying on ``code_owner``. Monitoring can switch from ``code_owner`` to ``code_owner_squad``, rather than a change for every theme update in the future.
Copy file name to clipboardExpand all lines: edx_django_utils/monitoring/docs/how_tos/add_code_owner_custom_attribute_to_an_ida.rst
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,20 @@ Add Code_Owner Custom Attribute to an IDA
5
5
:local:
6
6
:depth: 2
7
7
8
-
What is the code_owner custom attribute?
9
-
----------------------------------------
8
+
What are the code owner custom attributes?
9
+
------------------------------------------
10
10
11
-
The code_owner custom attribute can be used to create custom dashboards and alerts for monitoring the things that you own. It was originally introduced for the LMS, as is described in this `ADR on monitoring by code owner`_.
11
+
The code owner custom attributes can be used to create custom dashboards and alerts for monitoring the things that you own. It was originally introduced for the LMS, as is described in this `ADR on monitoring by code owner`_.
12
+
13
+
The code owner custom attributes consist of:
14
+
15
+
* code_owner: The owner name. When themes and squads are used, this will be the theme and squad names joined by a hyphen.
16
+
* code_owner_theme: The theme name of the owner.
17
+
* code_owner_squad: The squad name of the owner. Use this to avoid issues when theme name changes.
12
18
13
19
You can now easily add this same attribute to any IDA so that your dashboards and alerts can work across multiple IDAs at once.
14
20
15
-
If you want to know about custom attributes in general, see: using_custom_attributes.rst.
21
+
If you want to know about custom attributes in general, see:doc:`using_custom_attributes`.
16
22
17
23
.. _ADR on monitoring by code owner: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/monitoring/docs/decisions/0001-monitoring-by-code-owner.rst
18
24
@@ -24,7 +30,7 @@ You simply need to add ``edx_django_utils.monitoring.CodeOwnerMonitoringMiddlewa
24
30
Handling celery tasks
25
31
---------------------
26
32
27
-
Celery tasks require use of a special decorator to set the ``code_owner`` custom attribute because no middleware will be run.
33
+
Celery tasks require use of a special decorator to set the ``code_owner`` custom attributes because no middleware will be run.
28
34
29
35
Here is an example::
30
36
@@ -47,23 +53,29 @@ An untested potential alternative to the decorator is documented in the `Code Ow
47
53
Configuring your app settings
48
54
-----------------------------
49
55
50
-
Once the Middleware is made available, simply set the Django Setting ``CODE_OWNER_MAPPINGS`` appropriately.
56
+
Once the Middleware is made available, simply set the Django Settings ``CODE_OWNER_MAPPINGS`` and ``CODE_OWNER_THEMES`` appropriately.
51
57
52
58
The following example shows how you can include an optional config for a catch-all using ``'*'``. Although you might expect this example to use Python, it is intentionally illustrated in YAML because the catch-all requires special care in YAML.
53
59
54
60
::
55
61
56
62
# YAML format of example CODE_OWNER_MAPPINGS
57
63
CODE_OWNER_MAPPINGS:
58
-
team-red:
64
+
theme-x-team-red:
59
65
- xblock_django
60
66
- openedx.core.djangoapps.xblock
61
-
team-blue:
67
+
theme-x-team-blue:
62
68
- '*' # IMPORTANT: you must surround * with quotes in yml
63
69
70
+
# YAML format of example CODE_OWNER_THEMES
71
+
CODE_OWNER_THEMES:
72
+
theme-x:
73
+
- theme-x-team-red
74
+
- theme-x-team-blue
75
+
64
76
How to find and fix code_owner mappings
65
77
---------------------------------------
66
78
67
-
If you are missing the `code_owner` custom attribute on a particular Transaction or Error, or if `code_owner` is matching the catch-all, but you want to add a more specific mapping, you can use the other `code_owner supporting attributes`_ to determine what the appropriate mappings should be.
79
+
If you are missing the `code_owner` custom attributes on a particular Transaction or Error, or if `code_owner` is matching the catch-all, but you want to add a more specific mapping, you can use the other `code_owner supporting attributes`_ to determine what the appropriate mappings should be.
0 commit comments