fix: Add management command monitoring pipeline#16
Draft
ktyagiapphelix2u wants to merge 2 commits intomainfrom
Draft
fix: Add management command monitoring pipeline#16ktyagiapphelix2u wants to merge 2 commits intomainfrom
ktyagiapphelix2u wants to merge 2 commits intomainfrom
Conversation
67e7bd0 to
02ad9fb
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
ManagementCommandMonitoringPipelineStepthat wraps Django management command execution with Datadog monitoring/observability.This is part of a multi-repo effort to add Datadog monitoring around management command execution using the Open edX Filters framework (OEP-50).
Changes
New Pipeline Step:
edx_filters_pipelines/management/pipelines/monitoring.pyManagementCommandMonitoringPipelineStep: PipelineStep implementation that wraps thecommand_runnercallable with Datadog monitoring contextmonitor_management_command(): Context manager that sets Datadog transaction name, custom attributes, and traces command executionfilters_pipelines.enable_management_command_monitoringwaffle flagWaffle Flag:
edx_filters_pipelines/waffle.pyENABLE_MANAGEMENT_COMMAND_MONITORING: Opt-in waffle flag to enable/disable monitoring per environment or commandTest Coverage:
tests/test_edx-filters-pipelines.pyextra_configDependencies:
requirements/test.inpytest-mockfor testingDatadog Attributes Set
When the waffle flag is enabled, the following custom attributes are sent to Datadog:
management_command.name— command name (e.g.,migrate)management_command.service_variant—lmsorcmsmanagement_command.transaction_name— e.g.,lms.management.migratemanagement_command.status—successorfailuremanagement_command.duration_seconds— execution timemanagement_command.exception_class— if exception raisedmanagement_command.exit_code— if SystemExit raisedTransaction name format:
{service_variant}.management.{command_name}Wiring
This pipeline step is bound to filter type
org.openedx.platform.management.command.execute.requested.v1viaOPEN_EDX_FILTERS_CONFIGin edx-internal.