Skip to content

Add first-class traceId support to TrackLog domain and activity tracking #527

@lbwexler

Description

@lbwexler

Summary

TrackLog currently has no dedicated traceId field. For client errors, the traceId is buried inside the data JSON blob (at data.error.traceId, added by hoist-react's TraceService). For server-side trackService.track() calls, no traceId is captured at all.

With distributed tracing now in place, traceId should be a first-class field on TrackLog — similar to correlationId — so it can be queried, displayed in the Admin Console's Activity Tracking tab, and used for trace correlation across the observability stack.

Proposed Changes

  • Add traceId column to the TrackLog domain class and xh_track_log table.
  • Capture traceId from the active OTel span context in TrackService.prepareEntry() (server-side), and accept it as a submitted field from client track calls.
  • Display traceId in the Admin Console Activity Tracking viewer (hoist-react change).
  • Include traceId in TrackLog.formatForJSON() output.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions