Skip to main content

Laminar.setTraceSessionId(sessionId)

Group this trace with others in a session.Parameters:Returns: voidOption A: Call inside an active span context
Option B: Pass via observe options
Notes:
  • Must run within an active span context to attach to the current trace.
  • Prefer setting the session ID at your request/turn entry point so child spans inherit it.

Laminar.setTraceUserId(userId)

Associate trace with a user.Parameters:Returns: voidOption A: Call inside an active span context
Option B: Pass via observe options
Notes:
  • Must run within an active span context to attach to the current trace.
  • Prefer pseudonymous IDs (avoid emails, names, phone numbers).

Laminar.setTraceMetadata(metadata)

Add key-value metadata to the trace.Parameters:Returns: voidOption A: Call inside an active span context
Option B: Pass via observe options
Notes:
  • Must run within an active span context to attach to the current trace.
  • A later call overwrites previous trace metadata—set all keys in one call.
  • Values must be JSON-serializable (non-primitive values are JSON-stringified). Stored under lmnr.association.properties.metadata.*.
Overwrite semantics examples

Laminar.getTraceId()

Get the current trace ID.Returns: string | null — UUID string or null if no active span.