mule-opentelemetry-module icon indicating copy to clipboard operation
mule-opentelemetry-module copied to clipboard

feature: custom span status operation

Open Maikels opened this issue 10 months ago • 3 comments

I was wondering if there ever will be an operation that makes it possible to set a current span's status?

If there is a flow where this operation exists it would set the current span status to whatever the user decides ?

Maikels avatar Feb 18 '25 13:02 Maikels

Hi @Maikels. When setting the span status, the module follows the OpenTelemetry Semantic Conventions, and it cannot be overridden by the user to avoid deviations from the standards.

Can you elaborate on why the user would want a different status?

manikmagar avatar Mar 03 '25 05:03 manikmagar

Thanks for the reply Manik.

I understand that this behavior is not ideal, as it contradicts the user's adherence to specific standards.

However, there are cases where setting the span status to ERROR is necessary to make audit users aware that something went wrong.

For example:

If a flow is initiated and needs to fetch information from a backend service, but the service returns unexpected or incorrect data, the flow may be unable to proceed. In such cases, a choice router could be implemented to set the span to ERROR, highlighting that the returned data does not meet the required criteria, or that the flow failed to continue

Maikels avatar Mar 03 '25 08:03 Maikels

@Maikels Thanks for the additional details. In the example you described, if the flow raised an error (either from the backend service propagated in the flow OR by using the Mule Validation module for data validation), the flow span should get an ERROR status correctly.

manikmagar avatar Mar 06 '25 07:03 manikmagar