dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

Support long running spans

Open amarziali opened this issue 3 years ago • 0 comments

What Does This Do

Add support for long running spans. Allows incomplete spans to be reported to datadog and partial results to be displayed into the live view. As well, this PR enables collecting complete traces for spans lasting more than 15 minutes.

The feature is released behind a configuration flag and it's disabled by default.

How does it work

Pending traces are scanned on a scheduled basis and if a long lasting span is found:

  • A copy of this span (same span_id, parent_it, trace_id) is added to the buffer. The span is tagged as partial (metrics[_dd.partial_version] with an incrementing number)
  • All finished spans also buffered on the same pending traces are flushed (similar to partial flush scenario)

Motivation

Today, due to internal datadog architecture, spans lasting more than 15 minutes may result in incomplete tracing. Additionally to this, spans are sent only when all pending ones are closed. Hence, live view won't display those ones.

Additional Notes

amarziali avatar Mar 18 '22 16:03 amarziali