- Added signals monitoring_support_process_request, monitoring_support_process_response, and monitoring_support_process_exception to the MonitoringSupportMiddleware to enable plugging in monitoring capabilities.
- Fix bug where code owner custom attributes were being defined, even when the CODE_OWNER_MAPPINGS setting was not defined.
- Remove unused
background_task
monitoring function. - Remove
get_current_transaction
(used internally only) from the public API.
- Added Datadog implementation of
set_monitoring_transaction_name
and refactored the functionality.
- Added support for python3.12
- Dropped support for python<3.12 versions
- Added a new method to backends for
tag_root_span_with_error
and added Datadog implementation of the functionality. - Uses the new method to tag the root span when processing exceptions.
- Renamed
CachedCustomMonitoringMiddleware
toMonitoringSupportMiddleware
and deprecated the old name. It will be removed in a future release.
- Added Datadog implementation of
function_trace
and allowed implementation to be configurable.
- FrontendMonitoringMiddleware now updates the Content-Length header if its already set.
- FrontendMonitoringMiddleware will now be enabled once waffle switch named
edx_django_utils.monitoring.enable_frontend_monitoring_middleware
is enabled.
- Added default value while getting content-type header to avoid KeyError.
- Added middleware named
FrontendMonitoringMiddleware
for inserting frontend monitoring HTML script tags to response, configured by new Django settingOPENEDX_TELEMETRY_FRONTEND_SCRIPTS
.
- Initial support for sending monitoring data to OpenTelemetry collector or Datadog agent, configured by new Django setting
OPENEDX_TELEMETRY
. See monitoring README for details.
- Added support for
Python 3.11
- Added support for
Python 3.12
- Dropped support for
Django 3.2
- Added manufacture_data management command
- Removed
edx_django_utils.cache.disable_forced_cache_miss_for_none
which was added in5.7.0
.
- Adjusted
get_plugin_apps
to log at info level rather than debug and with more detail, though with a comment that this may not actually end up logging.
- Support added for Django 4.2
- Fixed bug where None was not properly being stored by TieredCache.
For backward compatibility,
edx_django_utils.cache.disable_forced_cache_miss_for_none
waffle switch has been added, which defaults to the old broken behavior of treating None as a cache miss.
- Updated and renamed new_relic_nrql_search to search in text widgets as well as NRQL queries
- Switched to
sphinx-book-theme
as the new standard theme across all Open edX repos. See https://github.com/openedx/edx-sphinx-theme/issues/184 for more details. - CookieMonitoringMiddleware will now remove cookies based on a
COOKIE_PREFIXES_TO_REMOVE
setting
- Added Content-Security-Policy response header middleware under
security/csp
- Report both specified and existing email when refusing to create a user
- Added a wrapper for background_task in monitoring.
- Utilities for safely determining the IP address of a request:
edx_django_utils.ip
(moved from edx-platform)
- License has been changed from AGPL v3 to Apache v2 to reflect existing policies
- Corrupt cookie logging:
- Make independent of other cookie logging; no longer needs to meet cookie size threshold or sampling rate.
- Breaking change, although low impact: Setting name changed from
UNUSUAL_COOKIE_SAMPLING_PUBLIC_KEY
toUNUSUAL_COOKIE_HEADER_PUBLIC_KEY
. - New setting
UNUSUAL_COOKIE_HEADER_LOG_CHUNK
helps avoid truncated (non-decryptable) messages by splitting the output across multiple log messages.
- Added ability to log headers when a corrupted cookie is detected in a large (or sampled) cookie header
Bad version -- tag does not match package version, not released to PyPI. Released as 4.8.1 instead.
- Added
encrypt_for_log
logging helper andlog-sensitive
CLI command for encrypted logging of sensitive information
- Added
CookieMonitoringMiddleware
for monitoring cookie header sizes and cookie sizes.
- Removed Django22, 30 and 31 from CI
- No longer clear the
RequestCache
during the exception-handling phase (wait until response phase)- It turns out all the
process_exception
methods get called until one returns a response, and only then do theprocess_response
methods start getting called. The result was that on exception, some middlewares were unable to use RequestCache'd values in their response phase.
- It turns out all the
- Replaced usage of 'django.conf.urls' with 'django.urls'
- Replaced usage of 'django.conf.urls.url()' with 'django.urls.re_path()'
- Added
DeploymentMonitoringMiddleware
to recordPython
andDjango
versions in NewRelic with each transaction.
- Added user and group management utilities.
- Added support for Django 3.1 and 3.2
- Added mixin for a custom Django admin class which disables CRUD operation on the admin's model.
- Script new_relic_nrql_search.py to search the NRQL in New Relic alert policies and dashboards using a supplied regex.
- 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.
- Added new
code_owner_theme
andcode_owner_squad
custom attributes. This is useful in cases where thecode_owner
combines a theme and squad name, because monitoring can instead referencecode_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.
- 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.
- Added
pluggable_override
decorator.
- Added chunked_queryset utility.
- Dropped support for Python 3.5.
- Added record_exception to monitor caught exceptions.
- Added additional details to the deprecated_monitoring_utils custom attribute values to make it simpler to track down usage.
- Added set_code_owner_attribute decorator for use with celery tasks.
- Added set_code_owner_attribute_from_module as an alternative to the decorator.
- Cleaned up some of the code owner middleware code. In doing so, renamed custom attribute code_owner_path_module to code_owner_module. This may affect monitoring dashboards. Also slightly changed when error custom attributes are set.
- Added ADR 0004-public-api-and-app-organization.rst to explain a new app organization, which makes use of the public API more consistent.
- Applied the new app organization described in th ADR to the monitoring Django app.
- Moved CachedCustomMonitoringMiddleware, CodeOwnerMonitoringMiddleware, and MonitoringMemoryMiddleware to the public API.
- Deprecated the old locations of CachedCustomMonitoringMiddleware, CodeOwnerMonitoringMiddleware, and MonitoringMemoryMiddleware.
- Deprecated various methods from modules that were always meant to be used from the public API.
- accumulate
- increment
- set_custom_attribute
- set_custom_attributes_for_course_key
- Added additional custom attributes for deprecated classes and methods to make them safer to retire.
Note
Some method implementations that were available in the public API were moved without adding a deprecated equivalent. These were not found when searching, so hopefully they are only used via the public API, which did not change. This includes functions in transactions.py
and code_owner/utils.py
.
- Removed the middleware ordering checks. This is not a typical Django feature and it is painful when refactoring.
- Added logging filter classes for users and remote IP addresses to be used by all IDAs. These were moved here from edx-platform.
- Exposed existing get_code_owner_from_module via the public api.
- Fixed get_code_owner_from_module to not require a call to is_code_owner_mappings_configured beforehand.
- Set the existing code_owner_path_module custom attribute, even for cases where the transaction name was used, rather than the view module.
- Refactor code owner setting processing.
- Renamed "custom metric" to "custom attribute" throughout the monitoring library. This decision can be read about in the ADR 0002-custom-monitoring-language.rst. The following have been deprecated:
- set_custom_metric (use set_custom_attribute)
- set_custom_metrics_for_course_key (use set_custom_attributes_for_course_key)
- MonitoringCustomMetricsMiddleware (use CachedCustomMonitoringMiddleware)
- CachedCustomMonitoringMiddleware.accumulate_metric (use CachedCustomMonitoringMiddleware.accumulate_attribute)
- This wasn't meant to be used publicly, but was deprecated just in case.
- CodeOwnerMetricMiddleware (use CodeOwnerMonitoringMiddleware)
- Fix to custom monitoring accumulate to actually accumulate rather than overwrite.
- Upgrade psutil to latest version
- Added missing classes to plugins public api. See
plugins.__init__.py
for latest api. - Updated plugin method names to be more descriptive. See
plugins.__init__.py
for latest.
Note
Although these changes are backwards incompatible, they are being added as a bug fix because plugins code release (3.7.0) is not yet in use.
- Exposing all public functions in edx_django_utils/plugins directory in its __init__.py file.
- this was done to keep inline with standard/pattern used in other packages in edx_django_utils
- Adding Plugin infrastructure
- Allows IDAs to use plugins
- Improved documentation for CodeOwnerMetricMiddleware, including a how_tos/add_code_owner_custom_metric_to_an_ida.rst for adding it to a new IDA.
- Added ignore_transaction monitoring utility to ignore transactions we don't want tracked.
- Moved transaction-related monitoring code into it's own file. Still exposed through __init__.py so it's a non-breaking change.
- Added a catch-all capability to CodeOwnerMetricMiddleware when CODE_OWNER_MAPPINGS includes a '*' as a team's module. The catch-all is used only if there is no other match.
- Added get_current_transaction for monitoring that returns a transaction object with a name property.
- Updated CodeOwnerMetricMiddleware to use NewRelic's current transaction for cases where resolve() doesn't work to determine the code_owner, like for Middleware.
- CodeOwnerMetricMiddleware was moved here (from edx-platform) in order to be able to take advantage of the
code_owner
metric in other IDAs. For details on this decision, see the ADR for monitoring code owner. See the docstring for more details on usage.
- Removed ceninusepy3 usage.
- Added support for python 3.8 and dropped support for Django versions older than 2.2
- imported get_cache_key in cache/__init__.py.
- Added get_cache_key utility.
- Fixed: Updated function tracing to accomodate changes in New Relic's 5.x Agent.
- Converted Middleware (from old style MIDDLEWARE_CLASSES to MIDDLEWARE).
- Removed support for Django versions < 1.11
- Fixed: RequestCache now properly uses thread.local.
- Fixed: CachedResponse.__repr__ now handles unicode.
- Add
data
dict property to better match legacy RequestCache interface.
- Change is_hit/is_miss to is_found.
- Fixed bug in TieredCacheMiddleware dependency declaration.
- Restored Python 3 support.
- Refactor/clean-up, including Middleware dependency checking.
- Docs updates and other cookiecutter updates.
- Split out TieredCacheMiddleware from RequestCacheMiddleware.
- Rename CacheUtilsMiddleware to RequestCacheMiddleware.
- Temporarily dropped Python 3 support to land this.
- Added cache and monitoring utilities.
- First release on PyPI.