NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

OpenTelemetry: make use of spanlinks for delayed messages

Open lailabougria opened this issue 2 years ago • 3 comments

Describe the feature.

Is your feature related to a problem? Please describe.

Delayed messages are by definition expected to arrive at a later time. At this point, connecting them to the parent trace is an anti-pattern as it may cause broken traces.

Having large time gaps in the trace also makes the trace less coherent and skews the overall trace duration. In addition, when using a tail-based sampling strategy, in most cases, a time-based criterion is used to mark the trace as completed. Then a sampling decision is made. Therefore, delayed messages should never be connected to the parent trace as the parent trace will probably have been completed by then. This doesn't only affect sampling scenarios, but could also affect any scenario in which there is short data retention, causing the span to exist in a vacuum without the parent trace.

Describe the requested feature

Delayed messages should not be connected as a child span, but rather start a new trace and make use of span links for correlation.

Describe alternatives you've considered

Additional Context

No response

lailabougria avatar May 02 '23 14:05 lailabougria

Should the same be done for retries? (both immediate and delayed)

andreasohlund avatar Apr 20 '24 06:04 andreasohlund

I wouldn't for immediate retries, they're immediate, after all. Do you see a strong reason to do so @andreasohlund ?

lailabougria avatar Apr 22 '24 12:04 lailabougria

Just to be consistent I guess since it is a brand new attempt, no strong opinion

andreasohlund avatar Apr 22 '24 12:04 andreasohlund

Addressed in #7049. Will be released in 9.1.0 soonish

SzymonPobiega avatar Jun 17 '24 08:06 SzymonPobiega