@sentry/opentelemetry 8.36.0-alpha.1 → 8.36.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.
@@ -279,19 +279,6 @@ function isSentryRequestSpan(span) {
279
279
  * Infer the op & description for a set of name, attributes and kind of a span.
280
280
  */
281
281
  function inferSpanData(name, attributes, kind) {
282
- // This attribute is intentionally exported as a SEMATTR constant because it should stay intimite API
283
- if (attributes['sentry.skip_span_data_inference']) {
284
- return {
285
- op: undefined,
286
- description: name,
287
- source: 'custom',
288
- data: {
289
- // Suggest to callers of `parseSpanDescription` to wipe the hint because it is unnecessary data in the end.
290
- 'sentry.skip_span_data_inference': undefined,
291
- },
292
- };
293
- }
294
-
295
282
  // if http.method exists, this is an http request span
296
283
  // eslint-disable-next-line deprecation/deprecation
297
284
  const httpMethod = attributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD] || attributes[semanticConventions.SEMATTRS_HTTP_METHOD];
@@ -1639,8 +1626,9 @@ class SentrySpanExporter {
1639
1626
  * We do this to avoid leaking memory.
1640
1627
  */
1641
1628
  _cleanupOldSpans(spans = this._finishedSpans) {
1629
+ const currentTimeSeconds = Date.now() / 1000;
1642
1630
  this._finishedSpans = spans.filter(span => {
1643
- const shouldDrop = shouldCleanupSpan(span, this._timeout);
1631
+ const shouldDrop = shouldCleanupSpan(span, currentTimeSeconds, this._timeout);
1644
1632
  DEBUG_BUILD &&
1645
1633
  shouldDrop &&
1646
1634
  utils.logger.log(
@@ -1708,8 +1696,8 @@ function getCompletedRootNodes(nodes) {
1708
1696
  return nodes.filter(nodeIsCompletedRootNode);
1709
1697
  }
1710
1698
 
1711
- function shouldCleanupSpan(span, maxStartTimeOffsetSeconds) {
1712
- const cutoff = Date.now() / 1000 - maxStartTimeOffsetSeconds;
1699
+ function shouldCleanupSpan(span, currentTimeSeconds, maxStartTimeOffsetSeconds) {
1700
+ const cutoff = currentTimeSeconds - maxStartTimeOffsetSeconds;
1713
1701
  return core.spanTimeInputToSeconds(span.startTime) < cutoff;
1714
1702
  }
1715
1703
 
@@ -1875,7 +1863,6 @@ function removeSentryAttributes(data) {
1875
1863
  /* eslint-disable @typescript-eslint/no-dynamic-delete */
1876
1864
  delete cleanedData[core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
1877
1865
  delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE];
1878
- delete cleanedData['sentry.skip_span_data_inference'];
1879
1866
  /* eslint-enable @typescript-eslint/no-dynamic-delete */
1880
1867
 
1881
1868
  return cleanedData;