o11y 250.4.0 → 250.5.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.
@@ -357,8 +357,8 @@ class PerformanceObservability {
357
357
  this._fuzzyMapper.clear();
358
358
  this._isStarted = false;
359
359
  }
360
- addEntry(url, perfTime, data) {
361
- this._fuzzyMapper.add(url, perfTime, data);
360
+ addEntry(absoluteUrl, perfTime, data) {
361
+ this._fuzzyMapper.add(absoluteUrl, perfTime, data);
362
362
  }
363
363
  _resourceEntryToResourceTiming(prt) {
364
364
  var _a, _b;
@@ -637,6 +637,7 @@ class Tracing {
637
637
  var _a;
638
638
  let activity;
639
639
  let url;
640
+ let absoluteUrl;
640
641
  let method;
641
642
  let fetchTime;
642
643
  try {
@@ -663,14 +664,16 @@ class Tracing {
663
664
  }
664
665
  options === null || options === void 0 ? true : delete options.o11y;
665
666
  url = resource === null || resource === void 0 ? void 0 : resource.toString();
667
+ absoluteUrl = utility.tryGetAbsoluteUrl(url);
666
668
  if (useTracing) {
667
669
  if (resource instanceof Request) {
668
670
  if (!method) {
669
671
  method = resource.method;
670
672
  }
671
673
  url = resource.url;
674
+ absoluteUrl = utility.tryGetAbsoluteUrl(url);
672
675
  }
673
- const traceHeaders = Tracing._getTraceHeaders(activity, tracingHeadersOptions, method, url);
676
+ const traceHeaders = Tracing._getTraceHeaders(activity, tracingHeadersOptions, method, absoluteUrl);
674
677
  if (!this._applyTraceHeaders(resource, options, traceHeaders) &&
675
678
  options === undefined) {
676
679
  options = {
@@ -697,7 +700,7 @@ class Tracing {
697
700
  const activityDuration = Tracing._endActivity(activity, url, method);
698
701
  if ((_a = Tracing._performanceObservability) === null || _a === void 0 ? void 0 : _a.isStarted) {
699
702
  const requestId = Tracing._extractHeader(headerRequestId, resource, options);
700
- Tracing._performanceObservability.addEntry(url, fetchTime, {
703
+ Tracing._performanceObservability.addEntry(absoluteUrl, fetchTime, {
701
704
  requestId,
702
705
  activityDuration
703
706
  });
@@ -736,7 +739,7 @@ class Tracing {
736
739
  if (xhr._o11y) {
737
740
  const activityDuration = Tracing._endActivity(xhr._o11y.activity, xhr._o11y.url, xhr._o11y.method);
738
741
  if (!failedAtInit && ((_a = Tracing._performanceObservability) === null || _a === void 0 ? void 0 : _a.isStarted)) {
739
- Tracing._performanceObservability.addEntry(xhr._o11y.url, xhr._o11y.sendTime, {
742
+ Tracing._performanceObservability.addEntry(xhr._o11y.absoluteUrl, xhr._o11y.sendTime, {
740
743
  requestId: xhr._o11y.requestId,
741
744
  activityDuration
742
745
  });
@@ -748,6 +751,7 @@ class Tracing {
748
751
  method,
749
752
  url: url === null || url === void 0 ? void 0 : url.toString()
750
753
  };
754
+ this._o11y.absoluteUrl = utility.tryGetAbsoluteUrl(this._o11y.url);
751
755
  Tracing._originalXhrOpen.call(this, method, url, async, username, password);
752
756
  };
753
757
  Tracing._originalXhr.prototype.setRequestHeader = function (name, value) {
@@ -765,7 +769,7 @@ class Tracing {
765
769
  xhr._o11y = xhr._o11y || {};
766
770
  xhr._o11y.activity = activity = instr.startActivity(activityName || defaultActivityNameForXhrSend);
767
771
  if (useTracing) {
768
- const traceHeaders = Tracing._getTraceHeaders(activity, options, xhr._o11y.method, xhr._o11y.url);
772
+ const traceHeaders = Tracing._getTraceHeaders(activity, options, xhr._o11y.method, xhr._o11y.absoluteUrl);
769
773
  Object.entries(traceHeaders).forEach((entry) => {
770
774
  xhr.setRequestHeader(entry[0], entry[1]);
771
775
  });
@@ -2531,7 +2535,7 @@ class ConsoleCollector {
2531
2535
  }
2532
2536
  }
2533
2537
 
2534
- const version = '250.4.0';
2538
+ const version = '250.5.0';
2535
2539
 
2536
2540
  const idleDetector = new IdleDetectorImpl({
2537
2541
  logThreshold: 300,