Skip to content

Bridge: set prov.session.id to OpenClaw session UUID, not sessionKey #187

@arniesaha

Description

@arniesaha

Problem

Split out from #180. The bridge sets prov.session.id from e.sessionKey (e.g. agent:main:main, agent:main:subagent:abc) rather than the OpenClaw session UUID that the native JSONL shipper writes to lakehouse.agent_events.session_id. That makes it impossible to join AgentWeave spans back to native-shipper rows by id.

Reference (current behavior in plugins/openclaw-agentweave-bridge/src/service.ts):

const sessionId = e.sessionKey || e.sessionId || ""
...
span.setAttribute("session.id", sessionId)
span.setAttribute("prov.session.id", sessionId)

The comment above that line ("sessionKey is the fully qualified identifier") is internally consistent for the bridge, but it diverges from what the native shipper records — so cross-system joins break.

Ask

Set prov.session.id (and the session.id resource/span attribute) to the same UUID OpenClaw's JSONL shipper uses. Confirm which diagnostic-event field carries that UUID — e.sessionId is a candidate but in current OpenClaw it's the bare agent name (e.g. main), not the UUID. May need a new field in the message.queued payload, or a lookup from sessionKey to the canonical UUID.

Keep the qualified sessionKey somewhere on the span (e.g. as prov.session.key) so the existing concurrent-turn / parent-linking heuristics still have what they need.

Verification

For a sample session, the same UUID appears in both:

  • lakehouse.agent_events (native shipper)
  • Tempo prov.session.id for spans of that session

Linked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions