avioconsulting / mule-opentelemetry-module

Mule Extension to generate OpenTelemetry traces and metrics
https://avioconsulting.github.io/mule-opentelemetry-module/
BSD 2-Clause "Simplified" License
24 stars 9 forks source link

Flow-refs with expression are missing parent context #195

Closed manikmagar closed 1 month ago

manikmagar commented 1 month ago

When a flow/subflow from an imported mule configuration are invoked, the span of the target flow is not connected to the parent context. The target flow's span appears as a root trace instead of a child of the main calling flow.

manikmagar commented 1 month ago

After a test for a given scenario, it was observed that Imported sub-flows or flows create correct spans and traces.

The issue was when the target flow was invoked using an expression -

<set-variable variableName="targetFlow" value="simple-subflow-logger"/>
<flow-ref name="#[vars.targetFlow]"/>

In this case, irrespective of where simple-subflow-logger exists (imported config or local config), the spans fromsimple-subflow-logger were getting attributed to root trace instead of under the simple-subflow-logger span.

I am renaming the issue to represent the finding.