@sentry/opentelemetry 9.0.0-alpha.0 → 9.0.0-alpha.2
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/LICENSE +1 -1
- package/build/cjs/index.js +2 -2
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +3 -3
- package/build/esm/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/package.json +2 -2
package/build/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ATTR_URL_FULL, SEMATTRS_HTTP_URL, ATTR_HTTP_REQUEST_METHOD, SEMATTRS_HTTP_METHOD, SEMATTRS_DB_SYSTEM, SEMATTRS_RPC_SERVICE, SEMATTRS_MESSAGING_SYSTEM, SEMATTRS_FAAS_TRIGGER, SEMATTRS_DB_STATEMENT, SEMATTRS_HTTP_TARGET, ATTR_HTTP_ROUTE, ATTR_HTTP_RESPONSE_STATUS_CODE, SEMATTRS_HTTP_STATUS_CODE, SEMATTRS_RPC_GRPC_STATUS_CODE } from '@opentelemetry/semantic-conventions';
|
|
2
|
-
import { parseUrl, getSanitizedUrlString, SDK_VERSION, addNonEnumerableProperty, isSentryRequestUrl, getClient, baggageHeaderToDynamicSamplingContext, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, stripUrlQueryAndFragment, spanToJSON,
|
|
2
|
+
import { parseUrl, getSanitizedUrlString, SDK_VERSION, addNonEnumerableProperty, isSentryRequestUrl, getClient, baggageHeaderToDynamicSamplingContext, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, stripUrlQueryAndFragment, spanToJSON, hasSpansEnabled, dynamicSamplingContextToSentryBaggageHeader, LRUMap, logger, parseBaggageHeader, SENTRY_BAGGAGE_KEY_PREFIX, generateSentryTraceHeader, stringMatchesSomePattern, getDynamicSamplingContextFromSpan, getCurrentScope, getDynamicSamplingContextFromScope, propagationContextFromHeaders, getIsolationScope, handleCallbackErrors, getRootSpan, spanToTraceContext, getTraceContextFromScope, getCapturedScopesOnSpan, setAsyncContextStrategy, getDefaultCurrentScope, getDefaultIsolationScope, SPAN_STATUS_OK, SPAN_STATUS_ERROR, getSpanStatusFromHttpCode, timedEventsToMeasurements, captureEvent, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, dropUndefinedKeys, getStatusMessage, spanTimeInputToSeconds, addChildSpanToSpan, setCapturedScopesOnSpan, logSpanStart, logSpanEnd, parseSampleRate, sampleSpan } from '@sentry/core';
|
|
3
3
|
export { getClient, getDynamicSamplingContextFromSpan } from '@sentry/core';
|
|
4
4
|
import * as api from '@opentelemetry/api';
|
|
5
5
|
import { trace, SpanKind, createContextKey, TraceFlags, propagation, INVALID_TRACEID, context, SpanStatusCode, ROOT_CONTEXT, isSpanContextValid } from '@opentelemetry/api';
|
|
@@ -606,7 +606,7 @@ function enhanceDscWithOpenTelemetryRootSpanName(client) {
|
|
|
606
606
|
// Also ensure sampling decision is correctly inferred
|
|
607
607
|
// In core, we use `spanIsSampled`, which just looks at the trace flags
|
|
608
608
|
// but in OTEL, we use a slightly more complex logic to be able to differntiate between unsampled and deferred sampling
|
|
609
|
-
if (
|
|
609
|
+
if (hasSpansEnabled()) {
|
|
610
610
|
const sampled = getSamplingDecision(rootSpan.spanContext());
|
|
611
611
|
dsc.sampled = sampled == undefined ? undefined : String(sampled);
|
|
612
612
|
}
|
|
@@ -2065,7 +2065,7 @@ class SentrySampler {
|
|
|
2065
2065
|
const parentSpan = getValidSpan(context);
|
|
2066
2066
|
const parentContext = parentSpan?.spanContext();
|
|
2067
2067
|
|
|
2068
|
-
if (!
|
|
2068
|
+
if (!hasSpansEnabled(options)) {
|
|
2069
2069
|
return wrapSamplingDecision({ decision: undefined, context, spanAttributes });
|
|
2070
2070
|
}
|
|
2071
2071
|
|