@sentry/opentelemetry 10.59.0 → 10.60.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.browser.js +1 -1
- package/build/cjs/index.js +1 -1
- package/build/cjs/{resource-D2T3VSoy.js → resource-DEULI4zI.js} +30 -7
- package/build/{esm/resource-P9iYHxcD.js.map → cjs/resource-DEULI4zI.js.map} +1 -1
- package/build/esm/index.browser.js +1 -1
- package/build/esm/index.js +2 -2
- package/build/esm/package.json +1 -1
- package/build/esm/{resource-P9iYHxcD.js → resource-PMlHXvcP.js} +31 -8
- package/build/{cjs/resource-D2T3VSoy.js.map → esm/resource-PMlHXvcP.js.map} +1 -1
- package/build/types/spanProcessor.d.ts +4 -0
- package/build/types/spanProcessor.d.ts.map +1 -1
- package/build/types-ts3.8/spanProcessor.d.ts +4 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { consoleSandbox } from '@sentry/core';
|
|
2
2
|
export { getClient, getDynamicSamplingContextFromSpan, shouldPropagateTraceForUrl, withStreamedSpan } from '@sentry/core';
|
|
3
|
-
export { S as SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, b as SentryPropagator, c as SentrySampler, d as SentrySpanProcessor, f as continueTrace, g as enhanceDscWithOpenTelemetryRootSpanName, h as getActiveSpan, i as getRequestSpanData, j as getScopesFromContext, k as getSentryResource, l as getSpanKind, m as getTraceContextForScope, n as isSentryRequestSpan, o as openTelemetrySetupCheck, p as setOpenTelemetryContextAsyncContextStrategy, q as setupEventContextTrace, r as spanHasAttributes, t as spanHasEvents, u as spanHasKind, v as spanHasName, w as spanHasParentId, x as spanHasStatus, y as startInactiveSpan, z as startSpan, A as startSpanManual, B as suppressTracing, C as withActiveSpan, D as wrapClientClass, E as wrapContextManagerClass, F as wrapSamplingDecision } from './resource-
|
|
3
|
+
export { S as SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, b as SentryPropagator, c as SentrySampler, d as SentrySpanProcessor, f as continueTrace, g as enhanceDscWithOpenTelemetryRootSpanName, h as getActiveSpan, i as getRequestSpanData, j as getScopesFromContext, k as getSentryResource, l as getSpanKind, m as getTraceContextForScope, n as isSentryRequestSpan, o as openTelemetrySetupCheck, p as setOpenTelemetryContextAsyncContextStrategy, q as setupEventContextTrace, r as spanHasAttributes, t as spanHasEvents, u as spanHasKind, v as spanHasName, w as spanHasParentId, x as spanHasStatus, y as startInactiveSpan, z as startSpan, A as startSpanManual, B as suppressTracing, C as withActiveSpan, D as wrapClientClass, E as wrapContextManagerClass, F as wrapSamplingDecision } from './resource-PMlHXvcP.js';
|
|
4
4
|
import '@opentelemetry/api';
|
|
5
5
|
import '@sentry/conventions/attributes';
|
|
6
6
|
import '@opentelemetry/core';
|
package/build/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as setIsSetup, e as buildContextWithSentryScopes, a as SENTRY_SCOPES_CONTEXT_KEY } from './resource-
|
|
2
|
-
export { S as SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, b as SentryPropagator, c as SentrySampler, d as SentrySpanProcessor, f as continueTrace, g as enhanceDscWithOpenTelemetryRootSpanName, h as getActiveSpan, i as getRequestSpanData, j as getScopesFromContext, k as getSentryResource, l as getSpanKind, m as getTraceContextForScope, n as isSentryRequestSpan, o as openTelemetrySetupCheck, p as setOpenTelemetryContextAsyncContextStrategy, q as setupEventContextTrace, r as spanHasAttributes, t as spanHasEvents, u as spanHasKind, v as spanHasName, w as spanHasParentId, x as spanHasStatus, y as startInactiveSpan, z as startSpan, A as startSpanManual, B as suppressTracing, C as withActiveSpan, D as wrapClientClass, E as wrapContextManagerClass, F as wrapSamplingDecision } from './resource-
|
|
1
|
+
import { s as setIsSetup, e as buildContextWithSentryScopes, a as SENTRY_SCOPES_CONTEXT_KEY } from './resource-PMlHXvcP.js';
|
|
2
|
+
export { S as SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, b as SentryPropagator, c as SentrySampler, d as SentrySpanProcessor, f as continueTrace, g as enhanceDscWithOpenTelemetryRootSpanName, h as getActiveSpan, i as getRequestSpanData, j as getScopesFromContext, k as getSentryResource, l as getSpanKind, m as getTraceContextForScope, n as isSentryRequestSpan, o as openTelemetrySetupCheck, p as setOpenTelemetryContextAsyncContextStrategy, q as setupEventContextTrace, r as spanHasAttributes, t as spanHasEvents, u as spanHasKind, v as spanHasName, w as spanHasParentId, x as spanHasStatus, y as startInactiveSpan, z as startSpan, A as startSpanManual, B as suppressTracing, C as withActiveSpan, D as wrapClientClass, E as wrapContextManagerClass, F as wrapSamplingDecision } from './resource-PMlHXvcP.js';
|
|
3
3
|
export { getClient, getDynamicSamplingContextFromSpan, shouldPropagateTraceForUrl, withStreamedSpan } from '@sentry/core';
|
|
4
4
|
import { ROOT_CONTEXT } from '@opentelemetry/api';
|
|
5
5
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.60.0","sideEffects":false}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as api from '@opentelemetry/api';
|
|
2
2
|
import { trace, SpanKind, createContextKey, TraceFlags, propagation, INVALID_TRACEID, context, SpanStatusCode, ROOT_CONTEXT, isSpanContextValid } from '@opentelemetry/api';
|
|
3
|
-
import { parseUrl, getSanitizedUrlString, SDK_VERSION, derefWeakRef, addNonEnumerableProperty, makeWeakRef, isSentryRequestUrl, getClient, baggageHeaderToDynamicSamplingContext, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, stripUrlQueryAndFragment, spanToJSON, hasSpansEnabled, dynamicSamplingContextToSentryBaggageHeader, LRUMap, debug, shouldPropagateTraceForUrl, parseBaggageHeader, SENTRY_BAGGAGE_KEY_PREFIX, generateSentryTraceHeader, generateTraceparentHeader, getDynamicSamplingContextFromSpan, getCurrentScope, getDynamicSamplingContextFromScope, getIsolationScope, propagationContextFromHeaders, shouldContinueTrace, spanToTraceContext, getTraceContextFromScope, generateTraceId, generateSpanId, _INTERNAL_safeMathRandom, getRootSpan, handleCallbackErrors, getCapturedScopesOnSpan, setAsyncContextStrategy, getDefaultIsolationScope, getDefaultCurrentScope, SPAN_STATUS_OK, SPAN_STATUS_ERROR, getSpanStatusFromHttpCode, _INTERNAL_safeDateNow, debounce, timedEventsToMeasurements, captureEvent, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, convertSpanLinksForEnvelope, getStatusMessage, spanTimeInputToSeconds, addChildSpanToSpan, setCapturedScopesOnSpan, logSpanStart, logSpanEnd,
|
|
3
|
+
import { parseUrl, getSanitizedUrlString, SDK_VERSION, derefWeakRef, addNonEnumerableProperty, makeWeakRef, isSentryRequestUrl, getClient, baggageHeaderToDynamicSamplingContext, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, stripUrlQueryAndFragment, spanToJSON, hasSpansEnabled, dynamicSamplingContextToSentryBaggageHeader, LRUMap, debug, shouldPropagateTraceForUrl, parseBaggageHeader, SENTRY_BAGGAGE_KEY_PREFIX, generateSentryTraceHeader, generateTraceparentHeader, getDynamicSamplingContextFromSpan, getCurrentScope, getDynamicSamplingContextFromScope, getIsolationScope, propagationContextFromHeaders, shouldContinueTrace, spanToTraceContext, getTraceContextFromScope, generateTraceId, generateSpanId, _INTERNAL_safeMathRandom, getRootSpan, handleCallbackErrors, getCapturedScopesOnSpan, setAsyncContextStrategy, getDefaultIsolationScope, getDefaultCurrentScope, SPAN_STATUS_OK, SPAN_STATUS_ERROR, getSpanStatusFromHttpCode, _INTERNAL_safeDateNow, debounce, timedEventsToMeasurements, captureEvent, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, convertSpanLinksForEnvelope, getStatusMessage, spanTimeInputToSeconds, hasSpanStreamingEnabled, addChildSpanToSpan, setCapturedScopesOnSpan, logSpanStart, logSpanEnd, safeSetSpanJSONAttributes, shouldIgnoreSpan, parseSampleRate, sampleSpan } from '@sentry/core';
|
|
4
4
|
import { URL_FULL, HTTP_URL, HTTP_REQUEST_METHOD, HTTP_METHOD, DB_SYSTEM_NAME, DB_SYSTEM, RPC_SERVICE, MESSAGING_SYSTEM, FAAS_TRIGGER, DB_STATEMENT, HTTP_TARGET, HTTP_ROUTE, HTTP_RESPONSE_STATUS_CODE, HTTP_STATUS_CODE, RPC_GRPC_STATUS_CODE, SERVICE_VERSION, SERVICE_NAME } from '@sentry/conventions/attributes';
|
|
5
5
|
import { W3CBaggagePropagator, isTracingSuppressed, suppressTracing as suppressTracing$1, SDK_INFO } from '@opentelemetry/core';
|
|
6
6
|
import { D as DEBUG_BUILD } from './debug-build-B98wrZ1j.js';
|
|
@@ -1304,8 +1304,13 @@ function getData(span) {
|
|
|
1304
1304
|
|
|
1305
1305
|
class SentrySpanProcessor {
|
|
1306
1306
|
constructor(options) {
|
|
1307
|
+
this._unsubscribePreprocessSpan = void 0;
|
|
1307
1308
|
setIsSetup("SentrySpanProcessor");
|
|
1308
1309
|
this._exporter = new SentrySpanExporter(options);
|
|
1310
|
+
this._client = options?.client ?? getClient();
|
|
1311
|
+
if (this._client && hasSpanStreamingEnabled(this._client)) {
|
|
1312
|
+
this._unsubscribePreprocessSpan = this._client.on("preprocessSpan", backfillStreamedSpanDataFromOtel);
|
|
1313
|
+
}
|
|
1309
1314
|
}
|
|
1310
1315
|
/**
|
|
1311
1316
|
* @inheritDoc
|
|
@@ -1317,6 +1322,7 @@ class SentrySpanProcessor {
|
|
|
1317
1322
|
* @inheritDoc
|
|
1318
1323
|
*/
|
|
1319
1324
|
async shutdown() {
|
|
1325
|
+
this._unsubscribePreprocessSpan?.();
|
|
1320
1326
|
this._exporter.clear();
|
|
1321
1327
|
}
|
|
1322
1328
|
/**
|
|
@@ -1341,21 +1347,38 @@ class SentrySpanProcessor {
|
|
|
1341
1347
|
setCapturedScopesOnSpan(span, scopes.scope, scopes.isolationScope);
|
|
1342
1348
|
}
|
|
1343
1349
|
logSpanStart(span);
|
|
1344
|
-
|
|
1345
|
-
client?.emit("spanStart", span);
|
|
1350
|
+
this._client?.emit("spanStart", span);
|
|
1346
1351
|
}
|
|
1347
1352
|
/** @inheritDoc */
|
|
1348
1353
|
onEnd(span) {
|
|
1349
1354
|
logSpanEnd(span);
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
client.emit("afterSpanEnd", span);
|
|
1355
|
+
this._client?.emit("spanEnd", span);
|
|
1356
|
+
if (this._client && hasSpanStreamingEnabled(this._client)) {
|
|
1357
|
+
this._client.emit("afterSpanEnd", span);
|
|
1354
1358
|
} else {
|
|
1355
1359
|
this._exporter.export(span);
|
|
1356
1360
|
}
|
|
1357
1361
|
}
|
|
1358
1362
|
}
|
|
1363
|
+
function backfillStreamedSpanDataFromOtel(spanJSON, hint) {
|
|
1364
|
+
const attributes = spanJSON.attributes;
|
|
1365
|
+
if (!attributes) {
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
const kind = hint?.spanKind ?? SpanKind.INTERNAL;
|
|
1369
|
+
const { op, description, source, data } = inferSpanData(spanJSON.name, attributes, kind);
|
|
1370
|
+
spanJSON.name = description;
|
|
1371
|
+
safeSetSpanJSONAttributes(spanJSON, {
|
|
1372
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,
|
|
1373
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,
|
|
1374
|
+
...data
|
|
1375
|
+
});
|
|
1376
|
+
if (kind !== SpanKind.INTERNAL) {
|
|
1377
|
+
safeSetSpanJSONAttributes(spanJSON, {
|
|
1378
|
+
"otel.kind": SpanKind[kind]
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1359
1382
|
|
|
1360
1383
|
class SentrySampler {
|
|
1361
1384
|
constructor(client) {
|
|
@@ -1632,4 +1655,4 @@ function getSentryResource(serviceNameFallback) {
|
|
|
1632
1655
|
}
|
|
1633
1656
|
|
|
1634
1657
|
export { startSpanManual as A, suppressTracing as B, withActiveSpan as C, wrapClientClass as D, wrapContextManagerClass as E, wrapSamplingDecision as F, SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION as S, SENTRY_SCOPES_CONTEXT_KEY as a, SentryPropagator as b, SentrySampler as c, SentrySpanProcessor as d, buildContextWithSentryScopes as e, continueTrace as f, enhanceDscWithOpenTelemetryRootSpanName as g, getActiveSpan as h, getRequestSpanData as i, getScopesFromContext as j, getSentryResource as k, getSpanKind as l, getTraceContextForScope as m, isSentryRequestSpan as n, openTelemetrySetupCheck as o, setOpenTelemetryContextAsyncContextStrategy as p, setupEventContextTrace as q, spanHasAttributes as r, setIsSetup as s, spanHasEvents as t, spanHasKind as u, spanHasName as v, spanHasParentId as w, spanHasStatus as x, startInactiveSpan as y, startSpan as z };
|
|
1635
|
-
//# sourceMappingURL=resource-
|
|
1658
|
+
//# sourceMappingURL=resource-PMlHXvcP.js.map
|