@sentry/opentelemetry 10.38.0 → 10.39.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.
@@ -697,7 +697,7 @@ class SentryPropagator extends core$1.W3CBaggagePropagator {
697
697
  const url = activeSpan && getCurrentURL(activeSpan);
698
698
 
699
699
  const { tracePropagationTargets, propagateTraceparent } = core.getClient()?.getOptions() || {};
700
- if (!shouldPropagateTraceForUrl(url, tracePropagationTargets, this._urlMatchesTargetsMap)) {
700
+ if (!core.shouldPropagateTraceForUrl(url, tracePropagationTargets, this._urlMatchesTargetsMap)) {
701
701
  DEBUG_BUILD &&
702
702
  core.debug.log('[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:', url);
703
703
  return;
@@ -765,36 +765,6 @@ class SentryPropagator extends core$1.W3CBaggagePropagator {
765
765
  }
766
766
  }
767
767
 
768
- const NOT_PROPAGATED_MESSAGE =
769
- '[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:';
770
-
771
- /**
772
- * Check if a given URL should be propagated to or not.
773
- * If no url is defined, or no trace propagation targets are defined, this will always return `true`.
774
- * You can also optionally provide a decision map, to cache decisions and avoid repeated regex lookups.
775
- */
776
- function shouldPropagateTraceForUrl(
777
- url,
778
- tracePropagationTargets,
779
- decisionMap,
780
- ) {
781
- if (typeof url !== 'string' || !tracePropagationTargets) {
782
- return true;
783
- }
784
-
785
- const cachedDecision = decisionMap?.get(url);
786
- if (cachedDecision !== undefined) {
787
- DEBUG_BUILD && !cachedDecision && core.debug.log(NOT_PROPAGATED_MESSAGE, url);
788
- return cachedDecision;
789
- }
790
-
791
- const decision = core.stringMatchesSomePattern(url, tracePropagationTargets);
792
- decisionMap?.set(url, decision);
793
-
794
- DEBUG_BUILD && !decision && core.debug.log(NOT_PROPAGATED_MESSAGE, url);
795
- return decision;
796
- }
797
-
798
768
  /**
799
769
  * Get propagation injection data for the given context.
800
770
  * The additional options can be passed to override the scope and client that is otherwise derived from the context.
@@ -2362,6 +2332,7 @@ function getValidSpan(context) {
2362
2332
 
2363
2333
  exports.getClient = core.getClient;
2364
2334
  exports.getDynamicSamplingContextFromSpan = core.getDynamicSamplingContextFromSpan;
2335
+ exports.shouldPropagateTraceForUrl = core.shouldPropagateTraceForUrl;
2365
2336
  exports.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION;
2366
2337
  exports.SentryPropagator = SentryPropagator;
2367
2338
  exports.SentrySampler = SentrySampler;
@@ -2377,7 +2348,6 @@ exports.isSentryRequestSpan = isSentryRequestSpan;
2377
2348
  exports.openTelemetrySetupCheck = openTelemetrySetupCheck;
2378
2349
  exports.setOpenTelemetryContextAsyncContextStrategy = setOpenTelemetryContextAsyncContextStrategy;
2379
2350
  exports.setupEventContextTrace = setupEventContextTrace;
2380
- exports.shouldPropagateTraceForUrl = shouldPropagateTraceForUrl;
2381
2351
  exports.spanHasAttributes = spanHasAttributes;
2382
2352
  exports.spanHasEvents = spanHasEvents;
2383
2353
  exports.spanHasKind = spanHasKind;