forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hamzawaleed01/upgrade-edx-enterprise-70f6f5a
- Loading branch information
Showing
10 changed files
with
312 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...core/lib/docs/decisions/0002-logging-and-monitoring-expected-errors-removed.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Logging and monitoring of expected errors removed | ||
================================================= | ||
|
||
Status | ||
------ | ||
|
||
Accepted | ||
|
||
Context | ||
------- | ||
|
||
The setting ``EXPECTED_ERRORS`` was used for both expected and ignored errors in edx-platform. | ||
|
||
The functionality supporting expected errors was added: | ||
|
||
* Because New Relic didn't yet support this for Python, and | ||
* Because it was thought that people may want more flexibility for marking errors as expected in addition to just the class name, and | ||
* The setting provides a place to document why the change is being made. | ||
|
||
Updates regarding these three original reasons: | ||
|
||
* New Relic now supports expected errors, so the custom functionality is redundant and complicated, and | ||
* This functionality has yet to be used, so it is also unnecessary. | ||
|
||
Note that the need for custom functionality for ignored errors differs from expected errors in the following ways: | ||
|
||
* New Relic still has problems from time to time where it stops ignoring errors that it is supposed to be ignoring, and this redundant functionality is used to catch that issue, and | ||
* Since New Relic does not capture details of ignored errors, the custom functionality to log these errors can still come in handy if more details are needed. | ||
|
||
This context can also be found in `[DEPR] Expected error part of EXPECTED_ERRORS`_. | ||
|
||
.. _[DEPR] Expected error part of EXPECTED_ERRORS: https://github.com/openedx/edx-platform/issues/32405 | ||
|
||
Decision | ||
________ | ||
|
||
The custom ignored error functionality proposed in 0001-logging-and-monitoring-ignored-errors.rst will remain in place, but the custom expected error functionality will be removed. | ||
|
||
Consequence | ||
----------- | ||
|
||
* A number of code changes are required to remove the expected functionality. | ||
|
||
* In many placed in the code, "expected" was used to mean "ignored and expected", and all such instances will be renamed to "ignored". | ||
* The setting ``EXPECTED_ERRORS`` will be renamed to ``IGNORED_ERRORS``, which better matches how it was being used in the first place. | ||
* The setting ``EXPECTED_ERRORS[REASON_EXPECTED]`` will be renamed to ``IGNORED_ERRORS[REASON_IGNORED]``. | ||
* The setting toggle ``EXPECTED_ERRORS[IS_IGNORED]`` will be removed, because it will now always be True. | ||
* The how-to will be renamed to how_tos/logging-and-monitoring-ignored-errors.rst. | ||
* For more details, see https://github.com/openedx/edx-platform/pull/33184 where this work is underway. | ||
|
||
* If anyone ever uses New Relic's expected error functionality, the reason for marking an error as expected would need to be captured elsewhere. |
41 changes: 0 additions & 41 deletions
41
openedx/core/lib/docs/how_tos/logging-and-monitoring-expected-errors.rst
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
openedx/core/lib/docs/how_tos/logging-and-monitoring-ignored-errors.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
How to log and monitor ignored errors | ||
====================================== | ||
|
||
What are ignored errors? | ||
------------------------------------- | ||
|
||
Operators of Open edX might use New Relic for monitoring, which can be configured to ignore errors. These errors get suppressed and leave no (stack) trace, and won't trigger error alerts. | ||
|
||
Monitoring ignored errors | ||
-------------------------- | ||
|
||
At a minimum, it is recommended that you add monitoring for any ignored errors. You do this by using the ``IGNORED_ERRORS`` setting. For details on configuring, see the documentation for `IGNORED_ERRORS settings and toggles on Readthedocs`_. | ||
|
||
This will provide an ``error_ignored`` custom attribute for every ignored error. This custom attribute can be used in the following ways. | ||
|
||
* Use ``SELECT * FROM TransactionError WHERE error_ignored IS True`` to find errors that should have been ignored, but are not. This may be due to a bug or misconfiguration in New Relic. | ||
|
||
Additionally, a subset of ignored errors that are configured as ignored will also get ``error_ignored_class`` and ``error_ignored_message`` custom attributes. | ||
|
||
* Using New Relic terminology, this extra error class and message data will live on the Transaction and not the TransactionError, because ignored errors won't have a TransactionError. | ||
* Use these additional custom attributes to help diagnose unexpected issues with ignored errors. | ||
|
||
.. _IGNORED_ERRORS settings and toggles on Readthedocs: https://edx.readthedocs.io/projects/edx-platform-technical/en/latest/search.html?q=IGNORED_ERRORS&check_keywords=yes&area=default | ||
|
||
Logging ignored errors | ||
----------------------- | ||
|
||
Following the same documentation as for monitoring, you can also enable logging with or without a stack trace. This additional information may be useful for tracking down the source of a mysterious appearance of an otherwise ignored error. | ||
|
||
More targeted scoping of errors | ||
------------------------------- | ||
|
||
The initial implementation only enables this functionality by error ``module.Class``. If you need to scope the monitoring/logging for a more limited subset, like for certain requests, the expectation would be to enhance and document these new capabilities. |
Oops, something went wrong.