How to do it
Send a valid W3Ctraceparent header with the webhook request. Most OpenTelemetry HTTP client instrumentations do this automatically.
-: version 00, the 32-character trace id, the 16-character id of your calling span, and the trace flags.
If you instrument manually, inject the context from the span that makes the call. For example, in Python:
What you see
automation.triggeris a child of the span named in yourtraceparent. It is the only Elementum span whose parent is outside Elementum.automation.workflowis a child of the trigger span, on your trace, with no span link.- Every action span of the run, and any sub-automation it starts, follows on the same trace.
- If one webhook call starts several automation runs, each run’s workflow span is a child of the same trigger span.
Rules Elementum applies
A missing or invalid header never causes the webhook to be rejected. The response status and body are the same with or without it.
Small differences on a continued trigger span
- The continued
automation.triggerspan arrives without theelementum.sourceattribute. Every other Elementum span keeps it. To select all Elementum spans, filter onservice.name = elementum. - The trigger span carries your
tracestate, if you sent one.
Which triggers can continue a trace
Only webhook triggers readtraceparent. Other ways to start an automation do not continue a caller’s trace. That includes record events, schedules, emails, on-demand runs from the app, and the automation execution API. Those runs start a new trace.
If you call another Elementum API with a traceparent, the run does not appear under your span. In some cases the Elementum spans can share your trace id without being attached to your span. Use a webhook trigger when you need a continued trace.
Runs that start a new trace
When there is no usabletraceparent, or the trigger is not a webhook, the run starts a new trace:
automation.triggeris a root span.automation.workflowis in the same trace and carries a span link to the trigger span, with the link attributeslink.type = probeandlink.probe.trace_id. See Span links.- The action spans are children of the workflow span.
In current releases, the workflow span of a run that starts a new trace can arrive without a parent, as a second top-level span in the same trace. Its span link and
elementum.automation.execution_id still connect it to the trigger and to its actions.Calls between Elementum automations
Include Trace Header is being released. Until it reaches your environment, a Send API Request call to another automation starts a new trace.
See Send trace headers to other systems.
Verify it works
- Send a webhook request with a
traceparentfrom an instrumented client. - Wait a few seconds, then open the trace by its trace id in your backend.
- Check that
automation.triggerappears directly under your calling span, and thatelementum.automation.trigger_typeisWEB_HOOK.