Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.9.2
Framework Version
No response
Link to Sentry event
https://prisjakt-ab.sentry.io/performance/trace/962f9a6f5f264f8986da7d9ace318b6f/
SDK Setup
No response
Steps to Reproduce
Due to how
|
if (getLocalParentId(span)) { |
|
const openSpanCount = this._finishedSpans.length; |
|
DEBUG_BUILD && logger.log(`SpanExporter has ${openSpanCount} unsent spans remaining`); |
|
this._cleanupOldSpans(); |
|
return; |
|
} |
only flushes spans once a root span has finished, any child spans for an operation that takes longer than 5 minutes (e.g. a cronjob) are dropped.
This is what the trace used to look like: https://prisjakt-ab.sentry.io/performance/trace/890f3ee3731e41119416f3964e90719f, this is now: https://prisjakt-ab.sentry.io/performance/trace/962f9a6f5f264f8986da7d9ace318b6f
I understand that this is to avoid leaking memory (makes sense, I guess), but it would be nice to perhaps configure this limit and disable it entirely.
Clearing old spans to avoid memory leak is not really an issue for batch operations that only consist of a single root span and terminate once it's completed anyway.
Furthermore, because of how
|
function shouldCleanupSpan(span: ReadableSpan, maxStartTimeOffsetSeconds: number): boolean { |
|
const cutoff = Date.now() / 1000 - maxStartTimeOffsetSeconds; |
|
return convertOtelTimeToSeconds(span.startTime) < cutoff; |
|
} |
works, any spans longer than 5 minutes are automatically discarded. Fortunately, the root span is still sent because cleanup is never attempted for a finished root span.
Expected Result
a
Actual Result
a
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.9.2
Framework Version
No response
Link to Sentry event
https://prisjakt-ab.sentry.io/performance/trace/962f9a6f5f264f8986da7d9ace318b6f/
SDK Setup
No response
Steps to Reproduce
Due to how
sentry-javascript/packages/opentelemetry/src/spanExporter.ts
Lines 53 to 58 in 1201eb2
This is what the trace used to look like: https://prisjakt-ab.sentry.io/performance/trace/890f3ee3731e41119416f3964e90719f, this is now: https://prisjakt-ab.sentry.io/performance/trace/962f9a6f5f264f8986da7d9ace318b6f
I understand that this is to avoid leaking memory (makes sense, I guess), but it would be nice to perhaps configure this limit and disable it entirely.
Clearing old spans to avoid memory leak is not really an issue for batch operations that only consist of a single root span and terminate once it's completed anyway.
Furthermore, because of how
sentry-javascript/packages/opentelemetry/src/spanExporter.ts
Lines 174 to 177 in 1201eb2
Expected Result
a
Actual Result
a