@sentry/opentelemetry 10.50.0-alpha.0 → 10.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2055,11 +2055,8 @@ class SentrySpanExporter {
2055
2055
  // We'll recursively add all the child spans to this array
2056
2056
  const spans = transactionEvent.spans || [];
2057
2057
 
2058
- let hasGenAiSpans = false;
2059
2058
  for (const child of root.children) {
2060
- if (createAndFinishSpanForOtelSpan(child, spans, sentSpans)) {
2061
- hasGenAiSpans = true;
2062
- }
2059
+ createAndFinishSpanForOtelSpan(child, spans, sentSpans);
2063
2060
  }
2064
2061
 
2065
2062
  // spans.sort() mutates the array, but we do not use this anymore after this point
@@ -2069,13 +2066,6 @@ class SentrySpanExporter {
2069
2066
  ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT)
2070
2067
  : spans;
2071
2068
 
2072
- if (hasGenAiSpans) {
2073
- transactionEvent.sdkProcessingMetadata = {
2074
- ...transactionEvent.sdkProcessingMetadata,
2075
- hasGenAiSpans: true,
2076
- };
2077
- }
2078
-
2079
2069
  const measurements = timedEventsToMeasurements(span.events);
2080
2070
  if (measurements) {
2081
2071
  transactionEvent.measurements = measurements;
@@ -2192,9 +2182,6 @@ function createTransactionForOtelSpan(span) {
2192
2182
  return transactionEvent;
2193
2183
  }
2194
2184
 
2195
- /**
2196
- * Returns `true` if this span or any descendant is a gen_ai span.
2197
- */
2198
2185
  function createAndFinishSpanForOtelSpan(node, spans, sentSpans) {
2199
2186
  const span = node.span;
2200
2187
 
@@ -2206,13 +2193,10 @@ function createAndFinishSpanForOtelSpan(node, spans, sentSpans) {
2206
2193
 
2207
2194
  // If this span should be dropped, we still want to create spans for the children of this
2208
2195
  if (shouldDrop) {
2209
- let hasGenAiSpans = false;
2210
2196
  node.children.forEach(child => {
2211
- if (createAndFinishSpanForOtelSpan(child, spans, sentSpans)) {
2212
- hasGenAiSpans = true;
2213
- }
2197
+ createAndFinishSpanForOtelSpan(child, spans, sentSpans);
2214
2198
  });
2215
- return hasGenAiSpans;
2199
+ return;
2216
2200
  }
2217
2201
 
2218
2202
  const span_id = span.spanContext().spanId;
@@ -2249,13 +2233,9 @@ function createAndFinishSpanForOtelSpan(node, spans, sentSpans) {
2249
2233
 
2250
2234
  spans.push(spanJSON);
2251
2235
 
2252
- let hasGenAiSpans = !!op?.startsWith('gen_ai.');
2253
2236
  node.children.forEach(child => {
2254
- if (createAndFinishSpanForOtelSpan(child, spans, sentSpans)) {
2255
- hasGenAiSpans = true;
2256
- }
2237
+ createAndFinishSpanForOtelSpan(child, spans, sentSpans);
2257
2238
  });
2258
- return hasGenAiSpans;
2259
2239
  }
2260
2240
 
2261
2241
  function getSpanData(span)