o11y 260.3.0 → 260.4.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.
Files changed (63) hide show
  1. package/dist/modules/o11y/client/client.js +48 -6
  2. package/dist/modules/o11y/client/client.js.map +1 -1
  3. package/dist/modules/o11y/client/interfaces/Activity.d.ts +3 -0
  4. package/dist/modules/o11y/client/interfaces/ActivityDetail.d.ts +4 -0
  5. package/dist/modules/o11y/client/interfaces/ActivityStartOptions.d.ts +3 -0
  6. package/dist/modules/o11y/client/interfaces-private/ActivityData.d.ts +3 -0
  7. package/dist/modules/o11y/client/library/ActivityImpl.d.ts +7 -1
  8. package/dist/modules/o11y/client/library/ActivityNoOp.d.ts +3 -0
  9. package/dist/modules/o11y/client/library/RootActivityNoOp.d.ts +4 -1
  10. package/dist/modules/o11y/client/shared/Utility.d.ts +2 -1
  11. package/dist/modules/o11y/client/version.d.ts +1 -1
  12. package/dist/modules/o11y/collectors/interfaces/Activity.d.ts +3 -0
  13. package/dist/modules/o11y/collectors/interfaces/ActivityDetail.d.ts +4 -0
  14. package/dist/modules/o11y/collectors/interfaces/ActivityStartOptions.d.ts +3 -0
  15. package/dist/modules/o11y/collectors/interfaces-private/ActivityData.d.ts +3 -0
  16. package/dist/modules/o11y/collectors/library/ActivityImpl.d.ts +7 -1
  17. package/dist/modules/o11y/collectors/library/ActivityNoOp.d.ts +3 -0
  18. package/dist/modules/o11y/collectors/library/RootActivityNoOp.d.ts +4 -1
  19. package/dist/modules/o11y/collectors/shared/Utility.d.ts +2 -1
  20. package/dist/modules/o11y/collectors/version.d.ts +1 -1
  21. package/dist/modules/o11y/core_envelope/core_envelope.js +1 -1
  22. package/dist/modules/o11y/core_envelope/core_envelope.js.map +1 -1
  23. package/dist/modules/o11y/core_envelope/interfaces/Activity.d.ts +3 -0
  24. package/dist/modules/o11y/core_envelope/interfaces/ActivityDetail.d.ts +4 -0
  25. package/dist/modules/o11y/core_envelope/interfaces/ActivityStartOptions.d.ts +3 -0
  26. package/dist/modules/o11y/core_envelope/interfaces-private/ActivityData.d.ts +3 -0
  27. package/dist/modules/o11y/core_envelope/library/ActivityImpl.d.ts +7 -1
  28. package/dist/modules/o11y/core_envelope/library/ActivityNoOp.d.ts +3 -0
  29. package/dist/modules/o11y/core_envelope/library/RootActivityNoOp.d.ts +4 -1
  30. package/dist/modules/o11y/core_envelope/shared/Utility.d.ts +2 -1
  31. package/dist/modules/o11y/core_envelope/version.d.ts +1 -1
  32. package/dist/modules/o11y/shared/interfaces/Activity.d.ts +3 -0
  33. package/dist/modules/o11y/shared/interfaces/ActivityDetail.d.ts +4 -0
  34. package/dist/modules/o11y/shared/interfaces/ActivityStartOptions.d.ts +3 -0
  35. package/dist/modules/o11y/shared/interfaces-private/ActivityData.d.ts +3 -0
  36. package/dist/modules/o11y/shared/library/ActivityImpl.d.ts +7 -1
  37. package/dist/modules/o11y/shared/library/ActivityNoOp.d.ts +3 -0
  38. package/dist/modules/o11y/shared/library/RootActivityNoOp.d.ts +4 -1
  39. package/dist/modules/o11y/shared/shared/Utility.d.ts +2 -1
  40. package/dist/modules/o11y/shared/shared.js +15 -0
  41. package/dist/modules/o11y/shared/shared.js.map +1 -1
  42. package/dist/modules/o11y/shared/version.d.ts +1 -1
  43. package/dist/modules/o11y/simple_collector/interfaces/Activity.d.ts +3 -0
  44. package/dist/modules/o11y/simple_collector/interfaces/ActivityDetail.d.ts +4 -0
  45. package/dist/modules/o11y/simple_collector/interfaces/ActivityStartOptions.d.ts +3 -0
  46. package/dist/modules/o11y/simple_collector/interfaces-private/ActivityData.d.ts +3 -0
  47. package/dist/modules/o11y/simple_collector/library/ActivityImpl.d.ts +7 -1
  48. package/dist/modules/o11y/simple_collector/library/ActivityNoOp.d.ts +3 -0
  49. package/dist/modules/o11y/simple_collector/library/RootActivityNoOp.d.ts +4 -1
  50. package/dist/modules/o11y/simple_collector/shared/Utility.d.ts +2 -1
  51. package/dist/modules/o11y/simple_collector/version.d.ts +1 -1
  52. package/dist/modules/o11y/web_vitals/interfaces/Activity.d.ts +3 -0
  53. package/dist/modules/o11y/web_vitals/interfaces/ActivityDetail.d.ts +4 -0
  54. package/dist/modules/o11y/web_vitals/interfaces/ActivityStartOptions.d.ts +3 -0
  55. package/dist/modules/o11y/web_vitals/interfaces-private/ActivityData.d.ts +3 -0
  56. package/dist/modules/o11y/web_vitals/library/ActivityImpl.d.ts +7 -1
  57. package/dist/modules/o11y/web_vitals/library/ActivityNoOp.d.ts +3 -0
  58. package/dist/modules/o11y/web_vitals/library/RootActivityNoOp.d.ts +4 -1
  59. package/dist/modules/o11y/web_vitals/shared/Utility.d.ts +2 -1
  60. package/dist/modules/o11y/web_vitals/version.d.ts +1 -1
  61. package/dist/modules/o11y/web_vitals/web_vitals.js +47 -5
  62. package/dist/modules/o11y/web_vitals/web_vitals.js.map +1 -1
  63. package/package.json +2 -2
@@ -995,13 +995,16 @@ const stopReason = {
995
995
  discarded
996
996
  };
997
997
  class ActivityImpl {
998
- constructor(_name, _rootId, _onStopped, _onError, timeout, id, _isSampled, _startPerfTime, _noRerooting) {
998
+ constructor(_name, _rootId, _onStopped, _onError, timeout, id, _isSampled, _startPerfTime, _noRerooting, _isExternal, _parentActivity) {
999
+ var _a, _b;
999
1000
  this._name = _name;
1000
1001
  this._rootId = _rootId;
1001
1002
  this._onStopped = _onStopped;
1002
1003
  this._onError = _onError;
1003
1004
  this._isSampled = _isSampled;
1004
1005
  this._noRerooting = _noRerooting;
1006
+ this._isExternal = _isExternal;
1007
+ this._parentActivity = _parentActivity;
1005
1008
  this._isRoot = false;
1006
1009
  this._errorCount = 0;
1007
1010
  this._timerOverridden = TimerOverride.none;
@@ -1018,7 +1021,7 @@ class ActivityImpl {
1018
1021
  try {
1019
1022
  performance.mark(this._perfId);
1020
1023
  }
1021
- catch (_a) {
1024
+ catch (_c) {
1022
1025
  this._usePerf = false;
1023
1026
  }
1024
1027
  }
@@ -1032,6 +1035,9 @@ class ActivityImpl {
1032
1035
  }, timeout);
1033
1036
  }
1034
1037
  this._safety = new PublicSafety();
1038
+ this._externalParentActivity = ((_a = this._parentActivity) === null || _a === void 0 ? void 0 : _a.isExternal())
1039
+ ? this._parentActivity
1040
+ : (_b = this._parentActivity) === null || _b === void 0 ? void 0 : _b.getExternalParentActivity();
1035
1041
  }
1036
1042
  get id() {
1037
1043
  return this._id;
@@ -1045,6 +1051,16 @@ class ActivityImpl {
1045
1051
  get stopReason() {
1046
1052
  return this._stopReason;
1047
1053
  }
1054
+ getParentActivity() {
1055
+ return this._parentActivity;
1056
+ }
1057
+ isExternal() {
1058
+ var _a;
1059
+ return (_a = this._isExternal) !== null && _a !== void 0 ? _a : false;
1060
+ }
1061
+ getExternalParentActivity() {
1062
+ return this._externalParentActivity;
1063
+ }
1048
1064
  error(error, userSchemaOrText, userData) {
1049
1065
  this._safety.tryCatch(() => {
1050
1066
  this._errorCount += 1;
@@ -1165,7 +1181,10 @@ class ActivityImpl {
1165
1181
  errorCount: this._errorCount,
1166
1182
  isSampled: this.getIsSampled(),
1167
1183
  timerOverridden: this._timerOverridden,
1168
- noRerooting: this._noRerooting
1184
+ noRerooting: this._noRerooting,
1185
+ isExternal: this._isExternal,
1186
+ parentActivity: this._parentActivity,
1187
+ externalParentActivity: this._externalParentActivity
1169
1188
  };
1170
1189
  }
1171
1190
  getTraceHeaders(options) {
@@ -1218,6 +1237,15 @@ class ActivityNoOp {
1218
1237
  getErrorCount() {
1219
1238
  return 0;
1220
1239
  }
1240
+ getParentActivity() {
1241
+ return undefined;
1242
+ }
1243
+ isExternal() {
1244
+ return false;
1245
+ }
1246
+ getExternalParentActivity() {
1247
+ return undefined;
1248
+ }
1221
1249
  }
1222
1250
  const activityNoOp = Object.freeze(new ActivityNoOp());
1223
1251
 
@@ -1648,6 +1676,7 @@ class InstrumentationImpl {
1648
1676
  var _a;
1649
1677
  utility.requireArgument(name, 'name');
1650
1678
  utility.requireArgumentIfDefined(options, 'options', 'object');
1679
+ const parentActivity = utility.validateParentActivityType(options === null || options === void 0 ? void 0 : options.isExternal, options === null || options === void 0 ? void 0 : options.parentActivity);
1651
1680
  let context;
1652
1681
  let noRerooting = (options === null || options === void 0 ? void 0 : options.perfStartOverride) !== undefined;
1653
1682
  const rootId = (_a = options === null || options === void 0 ? void 0 : options.instrumentationContext) === null || _a === void 0 ? void 0 : _a.rootId;
@@ -1661,11 +1690,12 @@ class InstrumentationImpl {
1661
1690
  else {
1662
1691
  context = this._nextGen.getDefaultInstrumentationContext();
1663
1692
  }
1664
- const activity = new ActivityImpl(name, context.rootId, this._onActivityStoppedCallback, this._onActivityErrorCallback, maxActivityDurationMsecs, options === null || options === void 0 ? void 0 : options.id, context.isRootActivitySampled, options === null || options === void 0 ? void 0 : options.perfStartOverride, noRerooting);
1693
+ const activity = new ActivityImpl(name, context.rootId, this._onActivityStoppedCallback, this._onActivityErrorCallback, maxActivityDurationMsecs, options === null || options === void 0 ? void 0 : options.id, context.isRootActivitySampled, options === null || options === void 0 ? void 0 : options.perfStartOverride, noRerooting, options === null || options === void 0 ? void 0 : options.isExternal, parentActivity);
1665
1694
  return activity;
1666
1695
  }, activityNoOp, { op: 'startActivity' });
1667
1696
  }
1668
1697
  _getActivityData(detail) {
1698
+ var _a, _b;
1669
1699
  const userPayload = this._wrapUserPayload(detail.userSchemaOrText, detail.userData, true);
1670
1700
  return {
1671
1701
  id: detail.id,
@@ -1676,7 +1706,10 @@ class InstrumentationImpl {
1676
1706
  errorCount: detail.errorCount,
1677
1707
  isSampled: detail.isSampled,
1678
1708
  timerOverridden: detail.timerOverridden,
1679
- isRerooted: detail.isRerooted
1709
+ isRerooted: detail.isRerooted,
1710
+ isExternal: detail.isExternal,
1711
+ parentId: (_a = detail.parentActivity) === null || _a === void 0 ? void 0 : _a.getId(),
1712
+ externalParentId: (_b = detail.externalParentActivity) === null || _b === void 0 ? void 0 : _b.getId()
1680
1713
  };
1681
1714
  }
1682
1715
  _handleActivityStop(detail) {
@@ -1954,6 +1987,15 @@ class RootActivityNoOp {
1954
1987
  getErrorCount() {
1955
1988
  return 0;
1956
1989
  }
1990
+ getParentActivity() {
1991
+ return undefined;
1992
+ }
1993
+ isExternal() {
1994
+ return false;
1995
+ }
1996
+ getExternalParentActivity() {
1997
+ return undefined;
1998
+ }
1957
1999
  }
1958
2000
  const rootActivityNoOp = Object.freeze(new RootActivityNoOp());
1959
2001
 
@@ -2709,7 +2751,7 @@ class ConsoleCollector {
2709
2751
  }
2710
2752
  }
2711
2753
 
2712
- const version = '260.3.0';
2754
+ const version = '260.4.0';
2713
2755
 
2714
2756
  const idleDetector = new IdleDetectorImpl({
2715
2757
  logThreshold: 300,