Skip to content

feat: add forum telemetry for thread update and delete#240

Merged
santhosh-apphelix-2u merged 1 commit intorelease-ulmofrom
COSMO2-853-thread-update-delete-instrumentation
Apr 21, 2026
Merged

feat: add forum telemetry for thread update and delete#240
santhosh-apphelix-2u merged 1 commit intorelease-ulmofrom
COSMO2-853-thread-update-delete-instrumentation

Conversation

@santhosh-apphelix-2u
Copy link
Copy Markdown

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.

Copilot AI review requested due to automatic review settings April 21, 2026 07:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_update with forum telemetry attributes, including update metadata.
  • Instrument destroy with 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))
@santhosh-apphelix-2u santhosh-apphelix-2u merged commit 5521789 into release-ulmo Apr 21, 2026
68 checks passed
@santhosh-apphelix-2u santhosh-apphelix-2u deleted the COSMO2-853-thread-update-delete-instrumentation branch April 21, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants