feat: add forum telemetry for thread update and delete#240
Merged
santhosh-apphelix-2u merged 1 commit intorelease-ulmofrom Apr 21, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Datadog forum telemetry to the thread update (PATCH) and thread delete (DELETE) endpoints in ThreadViewSet, capturing operation/entity/actor/course context and success/error outcomes.
Changes:
- Instrument
partial_updatewith forum telemetry attributes, including update metadata. - Instrument
destroywith forum telemetry attributes, including delete metadata. - Add error telemetry (
result,http_status,error_type) for both flows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+815
to
+818
| course_id = request.data.get("course_id") or get_course_id_from_thread_id( | ||
| thread_id | ||
| ) | ||
| set_custom_attribute("forum.course_id", str(course_id)) |
| set_custom_attribute("forum.course_id", str(course_id)) | ||
|
|
||
| update_fields = [ | ||
| field for field, value in request.data.items() if value is not None |
Comment on lines
+844
to
+847
| except Exception as exc: | ||
| set_custom_attribute("forum.result", "error") | ||
| set_custom_attribute("forum.http_status", str(status.HTTP_400_BAD_REQUEST)) | ||
| set_custom_attribute("forum.error_type", _discussion_error_type(exc)) |
Comment on lines
+861
to
+862
| course_id = get_course_id_from_thread_id(thread_id) | ||
| set_custom_attribute("forum.course_id", str(course_id)) |
Comment on lines
+869
to
+872
| except Exception as exc: | ||
| set_custom_attribute("forum.result", "error") | ||
| set_custom_attribute("forum.http_status", str(status.HTTP_400_BAD_REQUEST)) | ||
| set_custom_attribute("forum.error_type", _discussion_error_type(exc)) |
naincy128
approved these changes
Apr 21, 2026
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.
Implements COSMO2-853 for the thread update and thread delete flows in edx-platform.
Adds Datadog forum telemetry for these actions, including operation, entity context, actor, course, result, HTTP status, and relevant update/delete metadata.