@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.
- package/build/cjs/index.js +4 -17
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +4 -17
- package/build/esm/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/spanExporter.d.ts.map +1 -1
- package/build/types/utils/parseSpanDescription.d.ts.map +1 -1
- package/package.json +4 -4
package/build/esm/index.js
CHANGED
|
@@ -276,19 +276,6 @@ function isSentryRequestSpan(span) {
|
|
|
276
276
|
* Infer the op & description for a set of name, attributes and kind of a span.
|
|
277
277
|
*/
|
|
278
278
|
function inferSpanData(name, attributes, kind) {
|
|
279
|
-
// This attribute is intentionally exported as a SEMATTR constant because it should stay intimite API
|
|
280
|
-
if (attributes['sentry.skip_span_data_inference']) {
|
|
281
|
-
return {
|
|
282
|
-
op: undefined,
|
|
283
|
-
description: name,
|
|
284
|
-
source: 'custom',
|
|
285
|
-
data: {
|
|
286
|
-
// Suggest to callers of `parseSpanDescription` to wipe the hint because it is unnecessary data in the end.
|
|
287
|
-
'sentry.skip_span_data_inference': undefined,
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
|
|
292
279
|
// if http.method exists, this is an http request span
|
|
293
280
|
// eslint-disable-next-line deprecation/deprecation
|
|
294
281
|
const httpMethod = attributes[ATTR_HTTP_REQUEST_METHOD] || attributes[SEMATTRS_HTTP_METHOD];
|
|
@@ -1636,8 +1623,9 @@ class SentrySpanExporter {
|
|
|
1636
1623
|
* We do this to avoid leaking memory.
|
|
1637
1624
|
*/
|
|
1638
1625
|
_cleanupOldSpans(spans = this._finishedSpans) {
|
|
1626
|
+
const currentTimeSeconds = Date.now() / 1000;
|
|
1639
1627
|
this._finishedSpans = spans.filter(span => {
|
|
1640
|
-
const shouldDrop = shouldCleanupSpan(span, this._timeout);
|
|
1628
|
+
const shouldDrop = shouldCleanupSpan(span, currentTimeSeconds, this._timeout);
|
|
1641
1629
|
DEBUG_BUILD &&
|
|
1642
1630
|
shouldDrop &&
|
|
1643
1631
|
logger.log(
|
|
@@ -1705,8 +1693,8 @@ function getCompletedRootNodes(nodes) {
|
|
|
1705
1693
|
return nodes.filter(nodeIsCompletedRootNode);
|
|
1706
1694
|
}
|
|
1707
1695
|
|
|
1708
|
-
function shouldCleanupSpan(span, maxStartTimeOffsetSeconds) {
|
|
1709
|
-
const cutoff =
|
|
1696
|
+
function shouldCleanupSpan(span, currentTimeSeconds, maxStartTimeOffsetSeconds) {
|
|
1697
|
+
const cutoff = currentTimeSeconds - maxStartTimeOffsetSeconds;
|
|
1710
1698
|
return spanTimeInputToSeconds(span.startTime) < cutoff;
|
|
1711
1699
|
}
|
|
1712
1700
|
|
|
@@ -1872,7 +1860,6 @@ function removeSentryAttributes(data) {
|
|
|
1872
1860
|
/* eslint-disable @typescript-eslint/no-dynamic-delete */
|
|
1873
1861
|
delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
|
|
1874
1862
|
delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE];
|
|
1875
|
-
delete cleanedData['sentry.skip_span_data_inference'];
|
|
1876
1863
|
/* eslint-enable @typescript-eslint/no-dynamic-delete */
|
|
1877
1864
|
|
|
1878
1865
|
return cleanedData;
|