Impact. Context
(Impact v0.0.1)
Copy Markdown
Stores Impact request context on the current OpenTelemetry baggage so that
the canonical impact.context.<key> attributes ride with the OTel context
across process boundaries (GenServer calls, Tasks, anywhere
OpenTelemetry.Ctx.attach/1 is used).
Reserved canonical keys: :user_id, :interaction_id, :version_id. Any
additional keys passed via :attributes are flattened under
impact.context.<key>.
Why baggage and not Process dict
Process dictionaries are local to one BEAM process. The agent loop in a
GenServer is a different process from the LiveView / controller that
started the trace, so storing context in Process.put/2 would only attach
it to spans created at the call site, not to spans created in the
GenServer. OTel baggage is part of the OTel context and propagates
automatically when the caller passes the context across the boundary.
Summary
Functions
Returns the current context as a map of impact.context.<key> => value,
ready to be merged into span attributes by Impact.Trace.
Functions
Returns the current context as a map of impact.context.<key> => value,
ready to be merged into span attributes by Impact.Trace.