@newrelic/browser-agent 1.263.0 → 1.265.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 (478) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -2
  3. package/dist/cjs/cdn/experimental.js +3 -7
  4. package/dist/cjs/cdn/pro.js +2 -2
  5. package/dist/cjs/cdn/spa.js +2 -2
  6. package/dist/cjs/common/aggregate/aggregator.js +2 -3
  7. package/dist/cjs/common/config/{state/configurable.js → configurable.js} +1 -1
  8. package/dist/cjs/common/config/{state/info.js → info.js} +1 -1
  9. package/dist/cjs/common/config/{state/init.js → init.js} +11 -8
  10. package/dist/cjs/common/config/{state/loader-config.js → loader-config.js} +1 -1
  11. package/dist/cjs/common/config/{state/runtime.js → runtime.js} +16 -5
  12. package/dist/cjs/common/constants/agent-constants.js +8 -0
  13. package/dist/cjs/common/constants/env.cdn.js +1 -1
  14. package/dist/cjs/common/constants/env.npm.js +1 -1
  15. package/dist/cjs/common/constants/runtime.js +1 -3
  16. package/dist/cjs/common/context/shared-context.js +1 -2
  17. package/dist/cjs/common/dispatch/global-event.js +1 -2
  18. package/dist/cjs/common/drain/drain.js +12 -18
  19. package/dist/cjs/common/event-emitter/contextual-ee.js +3 -4
  20. package/dist/cjs/common/event-listener/event-listener-opts.js +2 -6
  21. package/dist/cjs/common/harvest/harvest-scheduler.js +1 -2
  22. package/dist/cjs/common/harvest/harvest.js +30 -57
  23. package/dist/cjs/common/serialize/bel-serializer.js +6 -11
  24. package/dist/cjs/common/session/session-entity.js +10 -13
  25. package/dist/cjs/common/timing/nav-timing.js +1 -3
  26. package/dist/cjs/common/timing/time-keeper.js +16 -6
  27. package/dist/cjs/common/url/encode.js +3 -7
  28. package/dist/cjs/common/util/console.js +2 -0
  29. package/dist/cjs/common/util/invoke.js +6 -16
  30. package/dist/cjs/common/util/obfuscate.js +97 -53
  31. package/dist/cjs/common/util/submit-data.js +17 -21
  32. package/dist/cjs/common/util/text.js +9 -0
  33. package/dist/cjs/common/util/traverse.js +1 -3
  34. package/dist/cjs/common/vitals/cumulative-layout-shift.js +5 -6
  35. package/dist/cjs/common/vitals/first-contentful-paint.js +4 -5
  36. package/dist/cjs/common/vitals/first-input-delay.js +4 -5
  37. package/dist/cjs/common/vitals/interaction-to-next-paint.js +5 -6
  38. package/dist/cjs/common/vitals/largest-contentful-paint.js +4 -5
  39. package/dist/cjs/common/vitals/time-to-first-byte.js +4 -5
  40. package/dist/cjs/common/vitals/vital-metric.js +5 -7
  41. package/dist/cjs/common/window/nreum.js +2 -1
  42. package/dist/cjs/common/window/page-visibility.js +1 -4
  43. package/dist/cjs/common/wrap/wrap-events.js +1 -4
  44. package/dist/cjs/common/wrap/wrap-promise.js +1 -4
  45. package/dist/cjs/common/wrap/wrap-websocket.js +74 -0
  46. package/dist/cjs/features/ajax/aggregate/chunk.js +4 -3
  47. package/dist/cjs/features/ajax/aggregate/gql.js +4 -5
  48. package/dist/cjs/features/ajax/aggregate/index.js +19 -22
  49. package/dist/cjs/features/ajax/constants.js +2 -3
  50. package/dist/cjs/features/ajax/instrument/distributed-tracing.js +9 -8
  51. package/dist/cjs/features/ajax/instrument/index.js +14 -12
  52. package/dist/cjs/features/generic_events/aggregate/index.js +128 -0
  53. package/dist/cjs/features/generic_events/constants.js +10 -0
  54. package/dist/cjs/features/generic_events/index.js +12 -0
  55. package/dist/cjs/features/generic_events/instrument/index.js +27 -0
  56. package/dist/cjs/features/jserrors/aggregate/index.js +25 -44
  57. package/dist/cjs/features/jserrors/instrument/index.js +4 -4
  58. package/dist/cjs/features/logging/aggregate/index.js +33 -36
  59. package/dist/cjs/features/logging/constants.js +2 -3
  60. package/dist/cjs/features/logging/instrument/index.js +5 -6
  61. package/dist/cjs/features/logging/shared/log.js +1 -3
  62. package/dist/cjs/features/logging/shared/utils.js +2 -4
  63. package/dist/cjs/features/metrics/aggregate/index.js +34 -17
  64. package/dist/cjs/features/metrics/aggregate/websocket-detection.js +34 -0
  65. package/dist/cjs/features/metrics/constants.js +4 -2
  66. package/dist/cjs/features/metrics/instrument/index.js +12 -4
  67. package/dist/cjs/features/page_action/instrument/index.js +14 -10
  68. package/dist/cjs/features/page_view_event/aggregate/index.js +19 -39
  69. package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -1
  70. package/dist/cjs/features/page_view_event/instrument/index.js +4 -4
  71. package/dist/cjs/features/page_view_timing/aggregate/index.js +23 -39
  72. package/dist/cjs/features/page_view_timing/instrument/index.js +4 -4
  73. package/dist/cjs/features/session_replay/aggregate/index.js +35 -42
  74. package/dist/cjs/features/session_replay/constants.js +1 -5
  75. package/dist/cjs/features/session_replay/instrument/index.js +5 -9
  76. package/dist/cjs/features/session_replay/shared/recorder-events.js +25 -20
  77. package/dist/cjs/features/session_replay/shared/recorder.js +17 -13
  78. package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +2 -2
  79. package/dist/cjs/features/session_replay/shared/utils.js +5 -4
  80. package/dist/cjs/features/session_trace/aggregate/index.js +25 -42
  81. package/dist/cjs/features/session_trace/aggregate/trace/storage.js +5 -3
  82. package/dist/cjs/features/session_trace/instrument/index.js +8 -7
  83. package/dist/cjs/features/soft_navigations/aggregate/ajax-node.js +1 -1
  84. package/dist/cjs/features/soft_navigations/aggregate/index.js +22 -30
  85. package/dist/cjs/features/soft_navigations/aggregate/initial-page-load-interaction.js +2 -2
  86. package/dist/cjs/features/soft_navigations/aggregate/interaction.js +4 -5
  87. package/dist/cjs/features/soft_navigations/instrument/index.js +14 -13
  88. package/dist/cjs/features/spa/aggregate/index.js +17 -28
  89. package/dist/cjs/features/spa/aggregate/interaction.js +7 -6
  90. package/dist/cjs/features/spa/aggregate/serializer.js +4 -5
  91. package/dist/cjs/features/spa/constants.js +2 -2
  92. package/dist/cjs/features/spa/instrument/index.js +20 -19
  93. package/dist/cjs/features/utils/agent-session.js +6 -4
  94. package/dist/cjs/features/utils/aggregate-base.js +17 -10
  95. package/dist/cjs/features/utils/event-buffer.js +132 -0
  96. package/dist/cjs/features/utils/feature-gates.js +2 -2
  97. package/dist/cjs/features/utils/instrument-base.js +7 -8
  98. package/dist/cjs/features/utils/lazy-feature-loader.js +12 -12
  99. package/dist/cjs/features/utils/nr1-debugger.js +1 -3
  100. package/dist/cjs/index.js +21 -0
  101. package/dist/cjs/loaders/agent-base.js +4 -12
  102. package/dist/cjs/loaders/agent.js +7 -2
  103. package/dist/cjs/loaders/api/api.js +23 -35
  104. package/dist/cjs/loaders/api/apiAsync.js +10 -13
  105. package/dist/cjs/loaders/browser-agent.js +4 -3
  106. package/dist/cjs/loaders/configure/configure.js +16 -15
  107. package/dist/cjs/loaders/features/enabled-features.js +2 -2
  108. package/dist/cjs/loaders/features/features.js +8 -4
  109. package/dist/cjs/loaders/micro-agent.js +16 -15
  110. package/dist/esm/cdn/experimental.js +2 -5
  111. package/dist/esm/cdn/pro.js +2 -2
  112. package/dist/esm/cdn/spa.js +2 -2
  113. package/dist/esm/common/aggregate/aggregator.js +2 -3
  114. package/dist/esm/common/config/{state/configurable.js → configurable.js} +1 -1
  115. package/dist/esm/common/config/{state/info.js → info.js} +1 -1
  116. package/dist/esm/common/config/{state/init.js → init.js} +11 -8
  117. package/dist/esm/common/config/{state/loader-config.js → loader-config.js} +1 -1
  118. package/dist/esm/common/config/{state/runtime.js → runtime.js} +17 -5
  119. package/dist/esm/common/constants/agent-constants.js +2 -0
  120. package/dist/esm/common/constants/env.cdn.js +1 -1
  121. package/dist/esm/common/constants/env.npm.js +1 -1
  122. package/dist/esm/common/constants/runtime.js +0 -2
  123. package/dist/esm/common/context/shared-context.js +1 -2
  124. package/dist/esm/common/dispatch/global-event.js +1 -2
  125. package/dist/esm/common/drain/drain.js +12 -18
  126. package/dist/esm/common/event-emitter/contextual-ee.js +2 -3
  127. package/dist/esm/common/event-listener/event-listener-opts.js +2 -6
  128. package/dist/esm/common/harvest/harvest-scheduler.js +1 -2
  129. package/dist/esm/common/harvest/harvest.js +24 -51
  130. package/dist/esm/common/serialize/bel-serializer.js +6 -11
  131. package/dist/esm/common/session/session-entity.js +10 -13
  132. package/dist/esm/common/timing/nav-timing.js +1 -3
  133. package/dist/esm/common/timing/time-keeper.js +15 -5
  134. package/dist/esm/common/url/encode.js +3 -7
  135. package/dist/esm/common/util/console.js +2 -0
  136. package/dist/esm/common/util/invoke.js +6 -16
  137. package/dist/esm/common/util/obfuscate.js +96 -49
  138. package/dist/esm/common/util/submit-data.js +17 -21
  139. package/dist/esm/common/util/text.js +3 -0
  140. package/dist/esm/common/util/traverse.js +1 -3
  141. package/dist/esm/common/vitals/cumulative-layout-shift.js +5 -6
  142. package/dist/esm/common/vitals/first-contentful-paint.js +4 -5
  143. package/dist/esm/common/vitals/first-input-delay.js +4 -5
  144. package/dist/esm/common/vitals/interaction-to-next-paint.js +5 -6
  145. package/dist/esm/common/vitals/largest-contentful-paint.js +4 -5
  146. package/dist/esm/common/vitals/time-to-first-byte.js +4 -5
  147. package/dist/esm/common/vitals/vital-metric.js +5 -7
  148. package/dist/esm/common/window/nreum.js +2 -1
  149. package/dist/esm/common/window/page-visibility.js +1 -4
  150. package/dist/esm/common/wrap/wrap-events.js +1 -4
  151. package/dist/esm/common/wrap/wrap-promise.js +1 -4
  152. package/dist/esm/common/wrap/wrap-websocket.js +67 -0
  153. package/dist/esm/features/ajax/aggregate/chunk.js +3 -2
  154. package/dist/esm/features/ajax/aggregate/gql.js +4 -5
  155. package/dist/esm/features/ajax/aggregate/index.js +16 -19
  156. package/dist/esm/features/ajax/constants.js +1 -2
  157. package/dist/esm/features/ajax/instrument/distributed-tracing.js +2 -1
  158. package/dist/esm/features/ajax/instrument/index.js +10 -8
  159. package/dist/esm/features/generic_events/aggregate/index.js +120 -0
  160. package/dist/esm/features/generic_events/constants.js +4 -0
  161. package/dist/esm/features/generic_events/index.js +1 -0
  162. package/dist/esm/features/generic_events/instrument/index.js +20 -0
  163. package/dist/esm/features/jserrors/aggregate/index.js +20 -39
  164. package/dist/esm/features/jserrors/instrument/index.js +3 -3
  165. package/dist/esm/features/logging/aggregate/index.js +31 -34
  166. package/dist/esm/features/logging/constants.js +1 -2
  167. package/dist/esm/features/logging/instrument/index.js +4 -5
  168. package/dist/esm/features/logging/shared/log.js +1 -3
  169. package/dist/esm/features/logging/shared/utils.js +2 -4
  170. package/dist/esm/features/metrics/aggregate/index.js +28 -11
  171. package/dist/esm/features/metrics/aggregate/websocket-detection.js +29 -0
  172. package/dist/esm/features/metrics/constants.js +3 -1
  173. package/dist/esm/features/metrics/instrument/index.js +12 -4
  174. package/dist/esm/features/page_action/instrument/index.js +14 -9
  175. package/dist/esm/features/page_view_event/aggregate/index.js +17 -37
  176. package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -1
  177. package/dist/esm/features/page_view_event/instrument/index.js +3 -3
  178. package/dist/esm/features/page_view_timing/aggregate/index.js +20 -36
  179. package/dist/esm/features/page_view_timing/instrument/index.js +3 -3
  180. package/dist/esm/features/session_replay/aggregate/index.js +25 -32
  181. package/dist/esm/features/session_replay/constants.js +0 -4
  182. package/dist/esm/features/session_replay/index.js +1 -7
  183. package/dist/esm/features/session_replay/instrument/index.js +5 -8
  184. package/dist/esm/features/session_replay/shared/recorder-events.js +25 -20
  185. package/dist/esm/features/session_replay/shared/recorder.js +14 -10
  186. package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +2 -2
  187. package/dist/esm/features/session_replay/shared/utils.js +3 -2
  188. package/dist/esm/features/session_trace/aggregate/index.js +20 -37
  189. package/dist/esm/features/session_trace/aggregate/trace/storage.js +5 -3
  190. package/dist/esm/features/session_trace/instrument/index.js +5 -4
  191. package/dist/esm/features/soft_navigations/aggregate/ajax-node.js +1 -1
  192. package/dist/esm/features/soft_navigations/aggregate/index.js +21 -29
  193. package/dist/esm/features/soft_navigations/aggregate/initial-page-load-interaction.js +1 -1
  194. package/dist/esm/features/soft_navigations/aggregate/interaction.js +2 -3
  195. package/dist/esm/features/soft_navigations/instrument/index.js +11 -10
  196. package/dist/esm/features/spa/aggregate/index.js +11 -22
  197. package/dist/esm/features/spa/aggregate/interaction.js +6 -5
  198. package/dist/esm/features/spa/aggregate/serializer.js +2 -3
  199. package/dist/esm/features/spa/constants.js +2 -2
  200. package/dist/esm/features/spa/instrument/index.js +12 -11
  201. package/dist/esm/features/utils/agent-session.js +3 -1
  202. package/dist/esm/features/utils/aggregate-base.js +16 -9
  203. package/dist/esm/features/utils/event-buffer.js +126 -0
  204. package/dist/esm/features/utils/feature-gates.js +1 -1
  205. package/dist/esm/features/utils/instrument-base.js +6 -7
  206. package/dist/esm/features/utils/lazy-feature-loader.js +12 -12
  207. package/dist/esm/features/utils/nr1-debugger.js +1 -3
  208. package/dist/esm/index.js +3 -0
  209. package/dist/esm/loaders/agent-base.js +4 -12
  210. package/dist/esm/loaders/agent.js +7 -2
  211. package/dist/esm/loaders/api/api.js +18 -30
  212. package/dist/esm/loaders/api/apiAsync.js +3 -6
  213. package/dist/esm/loaders/browser-agent.js +3 -2
  214. package/dist/esm/loaders/configure/configure.js +9 -8
  215. package/dist/esm/loaders/features/enabled-features.js +1 -1
  216. package/dist/esm/loaders/features/features.js +8 -4
  217. package/dist/esm/loaders/micro-agent.js +11 -10
  218. package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
  219. package/dist/types/common/config/configurable.d.ts.map +1 -0
  220. package/dist/types/common/config/info.d.ts.map +1 -0
  221. package/dist/types/common/config/init.d.ts.map +1 -0
  222. package/dist/types/common/config/loader-config.d.ts.map +1 -0
  223. package/dist/types/common/config/runtime.d.ts.map +1 -0
  224. package/dist/types/common/constants/agent-constants.d.ts +3 -0
  225. package/dist/types/common/constants/agent-constants.d.ts.map +1 -0
  226. package/dist/types/common/constants/runtime.d.ts +0 -1
  227. package/dist/types/common/constants/runtime.d.ts.map +1 -1
  228. package/dist/types/common/harvest/harvest.d.ts +1 -7
  229. package/dist/types/common/harvest/harvest.d.ts.map +1 -1
  230. package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
  231. package/dist/types/common/timing/time-keeper.d.ts +9 -2
  232. package/dist/types/common/timing/time-keeper.d.ts.map +1 -1
  233. package/dist/types/common/url/encode.d.ts.map +1 -1
  234. package/dist/types/common/util/console.d.ts.map +1 -1
  235. package/dist/types/common/util/obfuscate.d.ts +78 -6
  236. package/dist/types/common/util/obfuscate.d.ts.map +1 -1
  237. package/dist/types/common/util/submit-data.d.ts.map +1 -1
  238. package/dist/types/common/util/text.d.ts +2 -0
  239. package/dist/types/common/util/text.d.ts.map +1 -0
  240. package/dist/types/common/window/nreum.d.ts.map +1 -1
  241. package/dist/types/common/wrap/wrap-websocket.d.ts +4 -0
  242. package/dist/types/common/wrap/wrap-websocket.d.ts.map +1 -0
  243. package/dist/types/features/ajax/aggregate/chunk.d.ts.map +1 -1
  244. package/dist/types/features/ajax/aggregate/index.d.ts +2 -3
  245. package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
  246. package/dist/types/features/ajax/constants.d.ts +0 -1
  247. package/dist/types/features/ajax/constants.d.ts.map +1 -1
  248. package/dist/types/features/ajax/instrument/distributed-tracing.d.ts.map +1 -1
  249. package/dist/types/features/ajax/instrument/index.d.ts +1 -0
  250. package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
  251. package/dist/types/features/{page_action → generic_events}/aggregate/index.d.ts +10 -10
  252. package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -0
  253. package/dist/types/features/generic_events/constants.d.ts +4 -0
  254. package/dist/types/features/generic_events/constants.d.ts.map +1 -0
  255. package/dist/types/features/generic_events/index.d.ts +2 -0
  256. package/dist/types/features/generic_events/index.d.ts.map +1 -0
  257. package/dist/types/features/generic_events/instrument/index.d.ts +7 -0
  258. package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -0
  259. package/dist/types/features/jserrors/aggregate/index.d.ts +2 -2
  260. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  261. package/dist/types/features/jserrors/instrument/index.d.ts +1 -0
  262. package/dist/types/features/jserrors/instrument/index.d.ts.map +1 -1
  263. package/dist/types/features/logging/aggregate/index.d.ts +4 -7
  264. package/dist/types/features/logging/aggregate/index.d.ts.map +1 -1
  265. package/dist/types/features/logging/constants.d.ts +0 -1
  266. package/dist/types/features/logging/constants.d.ts.map +1 -1
  267. package/dist/types/features/logging/instrument/index.d.ts +1 -0
  268. package/dist/types/features/logging/instrument/index.d.ts.map +1 -1
  269. package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
  270. package/dist/types/features/metrics/aggregate/websocket-detection.d.ts +12 -0
  271. package/dist/types/features/metrics/aggregate/websocket-detection.d.ts.map +1 -0
  272. package/dist/types/features/metrics/constants.d.ts +1 -0
  273. package/dist/types/features/metrics/constants.d.ts.map +1 -1
  274. package/dist/types/features/metrics/instrument/index.d.ts +1 -0
  275. package/dist/types/features/metrics/instrument/index.d.ts.map +1 -1
  276. package/dist/types/features/page_action/instrument/index.d.ts +9 -4
  277. package/dist/types/features/page_action/instrument/index.d.ts.map +1 -1
  278. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  279. package/dist/types/features/page_view_event/instrument/index.d.ts +1 -0
  280. package/dist/types/features/page_view_event/instrument/index.d.ts.map +1 -1
  281. package/dist/types/features/page_view_timing/aggregate/index.d.ts +2 -2
  282. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  283. package/dist/types/features/page_view_timing/instrument/index.d.ts +1 -0
  284. package/dist/types/features/page_view_timing/instrument/index.d.ts.map +1 -1
  285. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  286. package/dist/types/features/session_replay/constants.d.ts +0 -4
  287. package/dist/types/features/session_replay/constants.d.ts.map +1 -1
  288. package/dist/types/features/session_replay/instrument/index.d.ts +1 -0
  289. package/dist/types/features/session_replay/instrument/index.d.ts.map +1 -1
  290. package/dist/types/features/session_replay/shared/recorder-events.d.ts +6 -6
  291. package/dist/types/features/session_replay/shared/recorder-events.d.ts.map +1 -1
  292. package/dist/types/features/session_replay/shared/recorder.d.ts +2 -2
  293. package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
  294. package/dist/types/features/session_replay/shared/utils.d.ts.map +1 -1
  295. package/dist/types/features/session_trace/aggregate/index.d.ts +2 -2
  296. package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
  297. package/dist/types/features/session_trace/aggregate/trace/storage.d.ts +1 -1
  298. package/dist/types/features/session_trace/aggregate/trace/storage.d.ts.map +1 -1
  299. package/dist/types/features/session_trace/instrument/index.d.ts +1 -0
  300. package/dist/types/features/session_trace/instrument/index.d.ts.map +1 -1
  301. package/dist/types/features/soft_navigations/aggregate/index.d.ts +3 -3
  302. package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
  303. package/dist/types/features/soft_navigations/instrument/index.d.ts +1 -0
  304. package/dist/types/features/soft_navigations/instrument/index.d.ts.map +1 -1
  305. package/dist/types/features/spa/aggregate/index.d.ts +2 -2
  306. package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
  307. package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -1
  308. package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -1
  309. package/dist/types/features/spa/constants.d.ts.map +1 -1
  310. package/dist/types/features/spa/instrument/index.d.ts +1 -0
  311. package/dist/types/features/spa/instrument/index.d.ts.map +1 -1
  312. package/dist/types/features/utils/agent-session.d.ts.map +1 -1
  313. package/dist/types/features/utils/aggregate-base.d.ts +1 -0
  314. package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
  315. package/dist/types/features/utils/event-buffer.d.ts +72 -0
  316. package/dist/types/features/utils/event-buffer.d.ts.map +1 -0
  317. package/dist/types/features/utils/instrument-base.d.ts +1 -0
  318. package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
  319. package/dist/types/index.d.ts +3 -0
  320. package/dist/types/loaders/agent-base.d.ts +1 -2
  321. package/dist/types/loaders/agent-base.d.ts.map +1 -1
  322. package/dist/types/loaders/agent.d.ts.map +1 -1
  323. package/dist/types/loaders/api/api.d.ts.map +1 -1
  324. package/dist/types/loaders/browser-agent.d.ts.map +1 -1
  325. package/dist/types/loaders/configure/configure.d.ts.map +1 -1
  326. package/dist/types/loaders/features/features.d.ts +1 -0
  327. package/dist/types/loaders/features/features.d.ts.map +1 -1
  328. package/dist/types/loaders/micro-agent.d.ts.map +1 -1
  329. package/package.json +67 -52
  330. package/src/cdn/experimental.js +2 -4
  331. package/src/cdn/pro.js +2 -2
  332. package/src/cdn/spa.js +2 -2
  333. package/src/common/aggregate/aggregator.js +2 -3
  334. package/src/common/config/__mocks__/info.js +3 -0
  335. package/src/common/config/__mocks__/init.js +3 -0
  336. package/src/common/config/__mocks__/loader-config.js +2 -0
  337. package/src/common/config/__mocks__/runtime.js +2 -0
  338. package/src/common/config/{state/configurable.js → configurable.js} +1 -1
  339. package/src/common/config/{state/info.js → info.js} +1 -1
  340. package/src/common/config/{state/init.js → init.js} +7 -6
  341. package/src/common/config/{state/loader-config.js → loader-config.js} +1 -1
  342. package/src/common/config/{state/runtime.js → runtime.js} +19 -5
  343. package/src/common/constants/agent-constants.js +2 -0
  344. package/src/common/constants/runtime.js +0 -2
  345. package/src/common/drain/drain.js +8 -6
  346. package/src/common/event-emitter/contextual-ee.js +1 -1
  347. package/src/common/harvest/harvest.js +10 -24
  348. package/src/common/serialize/bel-serializer.js +6 -9
  349. package/src/common/session/session-entity.js +4 -4
  350. package/src/common/timing/__mocks__/time-keeper.js +6 -2
  351. package/src/common/timing/time-keeper.js +15 -5
  352. package/src/common/url/encode.js +2 -3
  353. package/src/common/util/__mocks__/console.js +1 -0
  354. package/src/common/util/__mocks__/obfuscate.js +5 -8
  355. package/src/common/util/console.js +2 -0
  356. package/src/common/util/obfuscate.js +94 -50
  357. package/src/common/util/submit-data.js +0 -1
  358. package/src/common/util/text.js +6 -0
  359. package/src/common/window/__mocks__/nreum.js +1 -1
  360. package/src/common/window/nreum.js +2 -1
  361. package/src/common/wrap/wrap-websocket.js +73 -0
  362. package/src/features/ajax/aggregate/chunk.js +3 -2
  363. package/src/features/ajax/aggregate/index.js +20 -19
  364. package/src/features/ajax/constants.js +0 -2
  365. package/src/features/ajax/instrument/distributed-tracing.js +2 -1
  366. package/src/features/ajax/instrument/index.js +9 -5
  367. package/src/features/generic_events/aggregate/index.js +139 -0
  368. package/src/features/generic_events/constants.js +5 -0
  369. package/src/features/generic_events/index.js +1 -0
  370. package/src/features/generic_events/instrument/index.js +24 -0
  371. package/src/features/jserrors/aggregate/index.js +18 -9
  372. package/src/features/jserrors/instrument/index.js +2 -0
  373. package/src/features/logging/aggregate/index.js +39 -31
  374. package/src/features/logging/constants.js +0 -2
  375. package/src/features/logging/instrument/index.js +2 -0
  376. package/src/features/logging/shared/utils.js +1 -1
  377. package/src/features/metrics/aggregate/index.js +24 -9
  378. package/src/features/metrics/aggregate/websocket-detection.js +31 -0
  379. package/src/features/metrics/constants.js +3 -0
  380. package/src/features/metrics/instrument/index.js +13 -1
  381. package/src/features/page_action/instrument/index.js +11 -6
  382. package/src/features/page_view_event/aggregate/index.js +8 -23
  383. package/src/features/page_view_event/aggregate/initialized-features.js +1 -1
  384. package/src/features/page_view_event/instrument/index.js +2 -0
  385. package/src/features/page_view_timing/aggregate/index.js +15 -18
  386. package/src/features/page_view_timing/instrument/index.js +2 -0
  387. package/src/features/session_replay/aggregate/index.js +13 -9
  388. package/src/features/session_replay/constants.js +0 -4
  389. package/src/features/session_replay/index.js +1 -7
  390. package/src/features/session_replay/instrument/index.js +3 -4
  391. package/src/features/session_replay/shared/recorder-events.js +27 -20
  392. package/src/features/session_replay/shared/recorder.js +13 -6
  393. package/src/features/session_replay/shared/stylesheet-evaluator.js +2 -2
  394. package/src/features/session_replay/shared/utils.js +3 -2
  395. package/src/features/session_trace/aggregate/index.js +16 -7
  396. package/src/features/session_trace/aggregate/trace/storage.js +6 -1
  397. package/src/features/session_trace/instrument/index.js +4 -1
  398. package/src/features/soft_navigations/aggregate/ajax-node.js +1 -1
  399. package/src/features/soft_navigations/aggregate/index.js +13 -15
  400. package/src/features/soft_navigations/aggregate/initial-page-load-interaction.js +1 -1
  401. package/src/features/soft_navigations/aggregate/interaction.js +1 -1
  402. package/src/features/soft_navigations/instrument/index.js +9 -5
  403. package/src/features/spa/aggregate/index.js +12 -20
  404. package/src/features/spa/aggregate/interaction.js +6 -5
  405. package/src/features/spa/aggregate/serializer.js +2 -3
  406. package/src/features/spa/constants.js +2 -2
  407. package/src/features/spa/instrument/index.js +9 -3
  408. package/src/features/utils/agent-session.js +3 -1
  409. package/src/features/utils/aggregate-base.js +13 -3
  410. package/src/features/utils/event-buffer.js +126 -0
  411. package/src/features/utils/feature-gates.js +1 -1
  412. package/src/features/utils/instrument-base.js +2 -1
  413. package/src/features/utils/lazy-feature-loader.js +2 -2
  414. package/src/index.js +3 -0
  415. package/src/loaders/agent-base.js +2 -6
  416. package/src/loaders/agent.js +7 -2
  417. package/src/loaders/api/api.js +3 -2
  418. package/src/loaders/api/apiAsync.js +2 -2
  419. package/src/loaders/browser-agent.js +5 -3
  420. package/src/loaders/configure/configure.js +9 -2
  421. package/src/loaders/features/enabled-features.js +1 -1
  422. package/src/loaders/features/features.js +8 -4
  423. package/src/loaders/micro-agent.js +5 -2
  424. package/dist/cjs/cdn/polyfills/lite.js +0 -16
  425. package/dist/cjs/cdn/polyfills/pro.js +0 -21
  426. package/dist/cjs/cdn/polyfills/spa.js +0 -22
  427. package/dist/cjs/cdn/polyfills.js +0 -24
  428. package/dist/cjs/common/config/config.js +0 -76
  429. package/dist/cjs/common/config/state/originals.js +0 -8
  430. package/dist/cjs/common/util/map-own.js +0 -31
  431. package/dist/cjs/common/wrap/index.js +0 -61
  432. package/dist/cjs/features/page_action/aggregate/index.js +0 -121
  433. package/dist/esm/cdn/polyfills/lite.js +0 -14
  434. package/dist/esm/cdn/polyfills/pro.js +0 -19
  435. package/dist/esm/cdn/polyfills/spa.js +0 -20
  436. package/dist/esm/cdn/polyfills.js +0 -27
  437. package/dist/esm/common/config/config.js +0 -11
  438. package/dist/esm/common/config/state/originals.js +0 -2
  439. package/dist/esm/common/util/map-own.js +0 -24
  440. package/dist/esm/common/wrap/index.js +0 -13
  441. package/dist/esm/features/page_action/aggregate/index.js +0 -114
  442. package/dist/types/cdn/polyfills/lite.d.ts +0 -2
  443. package/dist/types/cdn/polyfills/lite.d.ts.map +0 -1
  444. package/dist/types/cdn/polyfills/pro.d.ts +0 -2
  445. package/dist/types/cdn/polyfills/pro.d.ts.map +0 -1
  446. package/dist/types/cdn/polyfills/spa.d.ts +0 -2
  447. package/dist/types/cdn/polyfills/spa.d.ts.map +0 -1
  448. package/dist/types/cdn/polyfills.d.ts +0 -2
  449. package/dist/types/cdn/polyfills.d.ts.map +0 -1
  450. package/dist/types/common/config/config.d.ts +0 -13
  451. package/dist/types/common/config/config.d.ts.map +0 -1
  452. package/dist/types/common/config/state/configurable.d.ts.map +0 -1
  453. package/dist/types/common/config/state/info.d.ts.map +0 -1
  454. package/dist/types/common/config/state/init.d.ts.map +0 -1
  455. package/dist/types/common/config/state/loader-config.d.ts.map +0 -1
  456. package/dist/types/common/config/state/originals.d.ts +0 -2
  457. package/dist/types/common/config/state/originals.d.ts.map +0 -1
  458. package/dist/types/common/config/state/runtime.d.ts.map +0 -1
  459. package/dist/types/common/util/map-own.d.ts +0 -3
  460. package/dist/types/common/util/map-own.d.ts.map +0 -1
  461. package/dist/types/common/wrap/index.d.ts +0 -10
  462. package/dist/types/common/wrap/index.d.ts.map +0 -1
  463. package/dist/types/features/page_action/aggregate/index.d.ts.map +0 -1
  464. package/src/cdn/polyfills/lite.js +0 -20
  465. package/src/cdn/polyfills/pro.js +0 -30
  466. package/src/cdn/polyfills/spa.js +0 -32
  467. package/src/cdn/polyfills.js +0 -27
  468. package/src/common/config/__mocks__/config.js +0 -11
  469. package/src/common/config/config.js +0 -12
  470. package/src/common/config/state/originals.js +0 -3
  471. package/src/common/util/map-own.js +0 -22
  472. package/src/common/wrap/index.js +0 -16
  473. package/src/features/page_action/aggregate/index.js +0 -114
  474. /package/dist/types/common/config/{state/configurable.d.ts → configurable.d.ts} +0 -0
  475. /package/dist/types/common/config/{state/info.d.ts → info.d.ts} +0 -0
  476. /package/dist/types/common/config/{state/init.d.ts → init.d.ts} +0 -0
  477. /package/dist/types/common/config/{state/loader-config.d.ts → loader-config.d.ts} +0 -0
  478. /package/dist/types/common/config/{state/runtime.d.ts → runtime.d.ts} +0 -0
@@ -4,30 +4,35 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.RecorderEvents = void 0;
7
+ var _eventBuffer = require("../../utils/event-buffer");
7
8
  class RecorderEvents {
8
- constructor() {
9
- /** The buffer to hold recorder event nodes */
10
- this.events = [];
11
- /** Payload metadata -- Should indicate when a replay blob started recording. Resets each time a harvest occurs.
9
+ /** The buffer to hold recorder event nodes */
10
+ #events = new _eventBuffer.EventBuffer(Infinity);
11
+ /** Payload metadata -- Should indicate when a replay blob started recording. Resets each time a harvest occurs.
12
12
  * cycle timestamps are used as fallbacks if event timestamps cannot be used
13
13
  */
14
- this.cycleTimestamp = Date.now();
15
- /** A value which increments with every new mutation node reported. Resets after a harvest is sent */
16
- this.payloadBytesEstimation = 0;
17
- /** Payload metadata -- Should indicate that the payload being sent has a full DOM snapshot. This can happen
18
- * -- When the recording library begins recording, it starts by taking a DOM snapshot
19
- * -- When visibility changes from "hidden" -> "visible", it must capture a full snapshot for the replay to work correctly across tabs
20
- */
21
- this.hasSnapshot = false;
22
- /** Payload metadata -- Should indicate that the payload being sent has a meta node. The meta node should always precede a snapshot node. */
23
- this.hasMeta = false;
24
- /** Payload metadata -- Should indicate that the payload being sent contains an error. Used for query/filter purposes in UI */
25
- this.hasError = false;
26
- /** Payload metadata -- Denotes whether all stylesheet elements were able to be inlined */
27
- this.inlinedAllStylesheets = true;
28
- }
14
+ cycleTimestamp = Date.now();
15
+ /** Payload metadata -- Should indicate that the payload being sent has a full DOM snapshot. This can happen
16
+ * -- When the recording library begins recording, it starts by taking a DOM snapshot
17
+ * -- When visibility changes from "hidden" -> "visible", it must capture a full snapshot for the replay to work correctly across tabs
18
+ */
19
+ hasSnapshot = false;
20
+ /** Payload metadata -- Should indicate that the payload being sent has a meta node. The meta node should always precede a snapshot node. */
21
+ hasMeta = false;
22
+ /** Payload metadata -- Should indicate that the payload being sent contains an error. Used for query/filter purposes in UI */
23
+ hasError = false;
24
+ /** Payload metadata -- Denotes whether all stylesheet elements were able to be inlined */
25
+ inlinedAllStylesheets = true;
29
26
  add(event) {
30
- this.events.push(event);
27
+ this.#events.add(event);
28
+ }
29
+ get events() {
30
+ return this.#events.buffer;
31
+ }
32
+
33
+ /** A value which increments with every new mutation node reported. Resets after a harvest is sent */
34
+ get payloadBytesEstimation() {
35
+ return this.#events.bytes;
31
36
  }
32
37
  }
33
38
  exports.RecorderEvents = RecorderEvents;
@@ -7,7 +7,7 @@ exports.Recorder = void 0;
7
7
  var _rrweb = require("rrweb");
8
8
  var _stringify = require("../../../common/util/stringify");
9
9
  var _constants = require("../constants");
10
- var _config = require("../../../common/config/config");
10
+ var _init = require("../../../common/config/init");
11
11
  var _recorderEvents = require("./recorder-events");
12
12
  var _constants2 = require("../../../common/session/constants");
13
13
  var _stylesheetEvaluator = require("./stylesheet-evaluator");
@@ -15,6 +15,7 @@ var _handle = require("../../../common/event-emitter/handle");
15
15
  var _constants3 = require("../../metrics/constants");
16
16
  var _features = require("../../../loaders/features/features");
17
17
  var _utils = require("./utils");
18
+ var _agentConstants = require("../../../common/constants/agent-constants");
18
19
  class Recorder {
19
20
  /** Each page mutation or event will be stored (raw) in this array. This array will be cleared on each harvest */
20
21
  #events;
@@ -37,17 +38,21 @@ class Recorder {
37
38
  /** The parent class that instantiated the recorder */
38
39
  this.parent = parent;
39
40
  /** Config to inform to inline stylesheet contents (true default) */
40
- this.shouldInlineStylesheets = (0, _config.getConfigurationValue)(this.parent.agentIdentifier, 'session_replay.inline_stylesheet');
41
+ this.shouldInlineStylesheets = (0, _init.getConfigurationValue)(this.parent.agentIdentifier, 'session_replay.inline_stylesheet');
41
42
  /** A flag that can be set to false by failing conversions to stop the fetching process */
42
- this.shouldFix = this.shouldInlineStylesheets && (0, _config.getConfigurationValue)(this.parent.agentIdentifier, 'session_replay.fix_stylesheets');
43
+ this.shouldFix = this.shouldInlineStylesheets && (0, _init.getConfigurationValue)(this.parent.agentIdentifier, 'session_replay.fix_stylesheets');
43
44
  /** The method to stop recording. This defaults to a noop, but is overwritten once the recording library is imported and initialized */
44
45
  this.stopRecording = () => {/* no-op until set by rrweb initializer */};
45
46
  }
46
47
  getEvents() {
47
- if (this.#preloaded[0]?.events.length) return {
48
- ...this.#preloaded[0],
49
- type: 'preloaded'
50
- };
48
+ if (this.#preloaded[0]?.events.length) {
49
+ return {
50
+ ...this.#preloaded[0],
51
+ events: this.#preloaded[0].events,
52
+ payloadBytesEstimation: this.#preloaded[0].payloadBytesEstimation,
53
+ type: 'preloaded'
54
+ };
55
+ }
51
56
  return {
52
57
  events: [...this.#backloggedEvents.events, ...this.#events.events].filter(x => x),
53
58
  type: 'standard',
@@ -80,7 +85,7 @@ class Recorder {
80
85
  inline_stylesheet,
81
86
  inline_images,
82
87
  collect_fonts
83
- } = (0, _config.getConfigurationValue)(this.parent.agentIdentifier, 'session_replay');
88
+ } = (0, _init.getConfigurationValue)(this.parent.agentIdentifier, 'session_replay');
84
89
  const customMasker = (text, element) => {
85
90
  if (element?.type?.toLowerCase() !== 'password' && (element?.dataset.nrUnmask !== undefined || element?.classList.contains('nr-unmask'))) return text;
86
91
  return '*'.repeat(text.length);
@@ -108,7 +113,8 @@ class Recorder {
108
113
  this.parent.ee.emit('internal-error', [err]);
109
114
  /** returning true informs rrweb to swallow the error instead of throwing it to the window */
110
115
  return true;
111
- }
116
+ },
117
+ recordAfter: 'DOMContentLoaded'
112
118
  });
113
119
  this.stopRecording = () => {
114
120
  this.recording = false;
@@ -186,11 +192,10 @@ class Recorder {
186
192
  this.currentBufferTarget.hasSnapshot = true;
187
193
  }
188
194
  this.currentBufferTarget.add(event);
189
- this.currentBufferTarget.payloadBytesEstimation += eventBytes;
190
195
 
191
196
  // We are making an effort to try to keep payloads manageable for unloading. If they reach the unload limit before their interval,
192
197
  // it will send immediately. This often happens on the first snapshot, which can be significantly larger than the other payloads.
193
- if ((event.type === _constants.RRWEB_EVENT_TYPES.FullSnapshot && this.currentBufferTarget.hasMeta || payloadSize > _constants.IDEAL_PAYLOAD_SIZE) && this.parent.mode === _constants2.MODE.FULL) {
198
+ if ((event.type === _constants.RRWEB_EVENT_TYPES.FullSnapshot && this.currentBufferTarget.hasMeta || payloadSize > _agentConstants.IDEAL_PAYLOAD_SIZE) && this.parent.mode === _constants2.MODE.FULL) {
194
199
  // if we've made it to the ideal size of ~64kb before the interval timer, we should send early.
195
200
  if (this.parent.scheduler) {
196
201
  this.parent.scheduler.runHarvest();
@@ -215,8 +220,7 @@ class Recorder {
215
220
  }
216
221
 
217
222
  /** Estimate the payload size */
218
- getPayloadSize() {
219
- let newBytes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
223
+ getPayloadSize(newBytes = 0) {
220
224
  // the query param padding constant gives us some padding for the other metadata to be safely injected
221
225
  return this.estimateCompression(this.currentBufferTarget.payloadBytesEstimation + newBytes) + _constants.QUERY_PARAM_PADDING;
222
226
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.stylesheetEvaluator = void 0;
7
- var _config = require("../../../common/config/config");
7
+ var _nreum = require("../../../common/window/nreum");
8
8
  var _runtime = require("../../../common/constants/runtime");
9
9
  class StylesheetEvaluator {
10
10
  #evaluated = new WeakSet();
@@ -62,7 +62,7 @@ class StylesheetEvaluator {
62
62
  async #fetchAndOverride(target) {
63
63
  if (!target?.href) return;
64
64
  try {
65
- const stylesheetContents = await _config.originals.FETCH.bind(window)(target.href);
65
+ const stylesheetContents = await (0, _nreum.gosNREUMOriginals)().o.FETCH.bind(window)(target.href);
66
66
  if (!stylesheetContents.ok) {
67
67
  this.failedToFix++;
68
68
  return;
@@ -6,18 +6,19 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.buildNRMetaNode = buildNRMetaNode;
7
7
  exports.hasReplayPrerequisite = hasReplayPrerequisite;
8
8
  exports.isPreloadAllowed = isPreloadAllowed;
9
- var _config = require("../../../common/config/config");
9
+ var _nreum = require("../../../common/window/nreum");
10
+ var _init = require("../../../common/config/init");
10
11
  var _featureGates = require("../../utils/feature-gates");
11
12
  var _runtime = require("../../../common/constants/runtime");
12
13
  function hasReplayPrerequisite(agentId) {
13
- return !!_config.originals.MO &&
14
+ return !!(0, _nreum.gosNREUMOriginals)().o.MO &&
14
15
  // Session Replay cannot work without Mutation Observer
15
16
  (0, _featureGates.canEnableSessionTracking)(agentId) &&
16
17
  // requires session tracking to be running (hence "session" replay...)
17
- (0, _config.getConfigurationValue)(agentId, 'session_trace.enabled') === true; // Session Replay as of now is tightly coupled with Session Trace in the UI
18
+ (0, _init.getConfigurationValue)(agentId, 'session_trace.enabled') === true; // Session Replay as of now is tightly coupled with Session Trace in the UI
18
19
  }
19
20
  function isPreloadAllowed(agentId) {
20
- return (0, _config.getConfigurationValue)(agentId, 'session_replay.preload') === true && hasReplayPrerequisite(agentId);
21
+ return (0, _init.getConfigurationValue)(agentId, 'session_replay.preload') === true && hasReplayPrerequisite(agentId);
21
22
  }
22
23
  function buildNRMetaNode(timestamp, timeKeeper) {
23
24
  const correctedTimestamp = timeKeeper.correctAbsoluteTimestamp(timestamp);
@@ -6,14 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.Aggregate = void 0;
7
7
  var _registerHandler = require("../../../common/event-emitter/register-handler");
8
8
  var _harvestScheduler = require("../../../common/harvest/harvest-scheduler");
9
- var _config = require("../../../common/config/config");
9
+ var _info = require("../../../common/config/info");
10
+ var _init = require("../../../common/config/init");
11
+ var _runtime = require("../../../common/config/runtime");
10
12
  var _constants = require("../constants");
11
13
  var _aggregateBase = require("../../utils/aggregate-base");
12
14
  var _storage = require("./trace/storage");
13
15
  var _encode = require("../../../common/url/encode");
14
16
  var _drain = require("../../../common/drain/drain");
15
- var _runtime = require("../../../common/constants/runtime");
17
+ var _runtime2 = require("../../../common/constants/runtime");
16
18
  var _constants2 = require("../../../common/session/constants");
19
+ var _traverse = require("../../../common/util/traverse");
17
20
  const ERROR_MODE_SECONDS_WINDOW = 30 * 1000; // sliding window of nodes to track when simply monitoring (but not harvesting) in error mode
18
21
  /** Reserved room for query param attrs */
19
22
  const QUERY_PARAM_PADDING = 5000;
@@ -21,12 +24,12 @@ class Aggregate extends _aggregateBase.AggregateBase {
21
24
  static featureName = _constants.FEATURE_NAME;
22
25
  constructor(agentIdentifier, aggregator) {
23
26
  super(agentIdentifier, aggregator, _constants.FEATURE_NAME);
24
- this.agentRuntime = (0, _config.getRuntime)(agentIdentifier);
25
- this.agentInfo = (0, _config.getInfo)(agentIdentifier);
27
+ this.agentRuntime = (0, _runtime.getRuntime)(agentIdentifier);
28
+ this.agentInfo = (0, _info.getInfo)(agentIdentifier);
26
29
 
27
30
  /** A buffer to hold on to harvested traces in the case that a retry must be made later */
28
31
  this.sentTrace = null;
29
- this.harvestTimeSeconds = (0, _config.getConfigurationValue)(agentIdentifier, 'session_trace.harvestTimeSeconds') || 30;
32
+ this.harvestTimeSeconds = (0, _init.getConfigurationValue)(agentIdentifier, 'session_trace.harvestTimeSeconds') || 30;
30
33
  /** Tied to the entitlement flag response from BCS. Will short circuit operations of the agg if false */
31
34
  this.entitled = undefined;
32
35
  /** A flag used to decide if the 30 node threshold should be ignored on the first harvest to ensure sending on the first payload */
@@ -36,15 +39,11 @@ class Aggregate extends _aggregateBase.AggregateBase {
36
39
  /** TraceStorage is the mechanism that holds, normalizes and aggregates ST nodes. It will be accessed and purged when harvests occur */
37
40
  this.traceStorage = new _storage.TraceStorage(this);
38
41
  /** This agg needs information about sampling (sts) and entitlements (st) to make the appropriate decisions on running */
39
- this.waitForFlags(['sts', 'st']).then(_ref => {
40
- let [stMode, stEntitled] = _ref;
41
- return this.initialize(stMode, stEntitled);
42
- });
42
+ this.waitForFlags(['sts', 'st']).then(([stMode, stEntitled]) => this.initialize(stMode, stEntitled));
43
43
  }
44
44
 
45
45
  /** Sets up event listeners, and initializes this module to run in the correct "mode". Can be triggered from a few places, but makes an effort to only set up listeners once */
46
46
  initialize(stMode, stEntitled, ignoreSession) {
47
- var _this = this;
48
47
  this.entitled ??= stEntitled;
49
48
  if (this.blocked || !this.entitled) return (0, _drain.deregisterDrain)(this.agentIdentifier, this.featureName);
50
49
  if (!this.initialized) {
@@ -84,31 +83,17 @@ class Aggregate extends _aggregateBase.AggregateBase {
84
83
  }, this);
85
84
 
86
85
  /** The handlers set up by the Inst file */
87
- (0, _registerHandler.registerHandler)('bst', function () {
88
- return _this.traceStorage.storeEvent(...arguments);
89
- }, this.featureName, this.ee);
90
- (0, _registerHandler.registerHandler)('bstResource', function () {
91
- return _this.traceStorage.storeResources(...arguments);
92
- }, this.featureName, this.ee);
93
- (0, _registerHandler.registerHandler)('bstHist', function () {
94
- return _this.traceStorage.storeHist(...arguments);
95
- }, this.featureName, this.ee);
96
- (0, _registerHandler.registerHandler)('bstXhrAgg', function () {
97
- return _this.traceStorage.storeXhrAgg(...arguments);
98
- }, this.featureName, this.ee);
99
- (0, _registerHandler.registerHandler)('bstApi', function () {
100
- return _this.traceStorage.storeSTN(...arguments);
101
- }, this.featureName, this.ee);
102
- (0, _registerHandler.registerHandler)('trace-jserror', function () {
103
- return _this.traceStorage.storeErrorAgg(...arguments);
104
- }, this.featureName, this.ee);
105
- (0, _registerHandler.registerHandler)('pvtAdded', function () {
106
- return _this.traceStorage.processPVT(...arguments);
107
- }, this.featureName, this.ee);
86
+ (0, _registerHandler.registerHandler)('bst', (...args) => this.traceStorage.storeEvent(...args), this.featureName, this.ee);
87
+ (0, _registerHandler.registerHandler)('bstResource', (...args) => this.traceStorage.storeResources(...args), this.featureName, this.ee);
88
+ (0, _registerHandler.registerHandler)('bstHist', (...args) => this.traceStorage.storeHist(...args), this.featureName, this.ee);
89
+ (0, _registerHandler.registerHandler)('bstXhrAgg', (...args) => this.traceStorage.storeXhrAgg(...args), this.featureName, this.ee);
90
+ (0, _registerHandler.registerHandler)('bstApi', (...args) => this.traceStorage.storeSTN(...args), this.featureName, this.ee);
91
+ (0, _registerHandler.registerHandler)('trace-jserror', (...args) => this.traceStorage.storeErrorAgg(...args), this.featureName, this.ee);
92
+ (0, _registerHandler.registerHandler)('pvtAdded', (...args) => this.traceStorage.processPVT(...args), this.featureName, this.ee);
108
93
  if (typeof PerformanceNavigationTiming !== 'undefined') {
109
- this.traceStorage.storeTiming(_runtime.globalScope.performance?.getEntriesByType?.('navigation')[0]);
94
+ this.traceStorage.storeTiming(_runtime2.globalScope.performance?.getEntriesByType?.('navigation')[0]);
110
95
  } else {
111
- this.traceStorage.storeTiming(_runtime.globalScope.performance?.timing);
96
+ this.traceStorage.storeTiming(_runtime2.globalScope.performance?.timing, true);
112
97
  }
113
98
 
114
99
  /** Only start actually harvesting if running in full mode at init time */
@@ -132,8 +117,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
132
117
  }
133
118
 
134
119
  /** Called by the harvest scheduler at harvest time to retrieve the payload. This will only actually return a payload if running in full mode */
135
- prepareHarvest() {
136
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
120
+ prepareHarvest(options = {}) {
137
121
  this.traceStorage.prevStoredEvents.clear(); // release references to past events for GC
138
122
  if (!this.timeKeeper?.ready) return; // this should likely never happen, but just to be safe, we should never harvest if we cant correct time
139
123
  if (this.blocked || this.mode !== _constants2.MODE.FULL || this.traceStorage.nodeCount === 0) return;
@@ -172,7 +156,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
172
156
  type: 'BrowserSessionChunk',
173
157
  app_id: this.agentInfo.applicationID,
174
158
  protocol_version: '0',
175
- timestamp: this.timeKeeper.convertRelativeTimestamp(earliestTimeStamp),
159
+ timestamp: Math.floor(this.timeKeeper.correctAbsoluteTimestamp(this.timeKeeper.convertRelativeTimestamp(earliestTimeStamp))),
176
160
  attributes: (0, _encode.obj)({
177
161
  ...(agentMetadata.entityGuid && {
178
162
  entityGuid: agentMetadata.entityGuid
@@ -181,8 +165,8 @@ class Aggregate extends _aggregateBase.AggregateBase {
181
165
  // this section of attributes must be controllable and stay below the query param padding limit -- see QUERY_PARAM_PADDING
182
166
  // if not, data could be lost to truncation at time of sending, potentially breaking parsing / API behavior in NR1
183
167
  // trace payload metadata
184
- 'trace.firstTimestamp': this.timeKeeper.convertRelativeTimestamp(earliestTimeStamp),
185
- 'trace.lastTimestamp': this.timeKeeper.convertRelativeTimestamp(latestTimeStamp),
168
+ 'trace.firstTimestamp': Math.floor(this.timeKeeper.correctAbsoluteTimestamp(this.timeKeeper.convertRelativeTimestamp(earliestTimeStamp))),
169
+ 'trace.lastTimestamp': Math.floor(this.timeKeeper.correctAbsoluteTimestamp(this.timeKeeper.convertRelativeTimestamp(latestTimeStamp))),
186
170
  'trace.nodes': stns.length,
187
171
  'trace.originTimestamp': this.timeKeeper.correctedOriginTime,
188
172
  // other payload metadata
@@ -197,12 +181,12 @@ class Aggregate extends _aggregateBase.AggregateBase {
197
181
  session: "".concat(this.sessionId),
198
182
  // customer-defined data should go last so that if it exceeds the query param padding limit it will be truncated instead of important attrs
199
183
  ...(endUserId && {
200
- 'enduser.id': endUserId
184
+ 'enduser.id': this.obfuscator.obfuscateString(endUserId)
201
185
  })
202
186
  // The Query Param is being arbitrarily limited in length here. It is also applied when estimating the size of the payload in getPayloadSize()
203
187
  }, QUERY_PARAM_PADDING).substring(1) // remove the leading '&'
204
188
  },
205
- body: stns
189
+ body: (0, _traverse.applyFnToProps)(stns, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string')
206
190
  };
207
191
  }
208
192
 
@@ -212,8 +196,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
212
196
  onHarvestFinished(result) {
213
197
  if (result.sent && result.retry && this.sentTrace) {
214
198
  // merge previous trace back into buffer to retry for next harvest
215
- Object.entries(this.sentTrace).forEach(_ref2 => {
216
- let [name, listOfSTNodes] = _ref2;
199
+ Object.entries(this.sentTrace).forEach(([name, listOfSTNodes]) => {
217
200
  this.traceStorage.restoreNode(name, listOfSTNodes);
218
201
  });
219
202
  this.sentTrace = null;
@@ -97,8 +97,7 @@ class TraceStorage {
97
97
  // if PO isn't supported, this checks resourcetiming buffer every harvest.
98
98
  this.storeResources(_runtime.globalScope.performance?.getEntriesByType?.('resource'));
99
99
  }
100
- const stns = Object.entries(this.trace).flatMap(_ref => {
101
- let [name, listOfSTNodes] = _ref;
100
+ const stns = Object.entries(this.trace).flatMap(([name, listOfSTNodes]) => {
102
101
  // basically take the "this.trace" map-obj and concat all the list-type values
103
102
  if (!(name in toAggregate)) return listOfSTNodes;
104
103
  // Special processing for event nodes dealing with user inputs:
@@ -156,7 +155,7 @@ class TraceStorage {
156
155
  return name === 'fi' && !!attrs && typeof attrs.fid === 'number';
157
156
  }
158
157
  }
159
- storeTiming(timingEntry) {
158
+ storeTiming(timingEntry, isAbsoluteTimestamp = false) {
160
159
  if (!timingEntry) return;
161
160
 
162
161
  // loop iterates through prototype also (for FF)
@@ -171,6 +170,9 @@ class TraceStorage {
171
170
  // that are in the future (Microsoft Edge seems to sometimes produce these)
172
171
  if (!(typeof val === 'number' && val >= 0)) continue;
173
172
  val = Math.round(val);
173
+ if (this.parent.timeKeeper && this.parent.timeKeeper.ready && isAbsoluteTimestamp) {
174
+ val = this.parent.timeKeeper.convertAbsoluteTimestamp(Math.floor(this.parent.timeKeeper.correctAbsoluteTimestamp(val)));
175
+ }
174
176
  this.storeSTN(new _node.TraceNode(key, val, val, 'document', 'timing'));
175
177
  }
176
178
  }
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Instrument = void 0;
6
+ exports.SessionTrace = exports.Instrument = void 0;
7
7
  var _handle = require("../../../common/event-emitter/handle");
8
- var _wrap = require("../../../common/wrap");
8
+ var _wrapHistory = require("../../../common/wrap/wrap-history");
9
+ var _wrapEvents = require("../../../common/wrap/wrap-events");
9
10
  var _instrumentBase = require("../../utils/instrument-base");
10
11
  var CONSTANTS = _interopRequireWildcard(require("../constants"));
11
12
  var _features = require("../../../loaders/features/features");
@@ -31,8 +32,7 @@ const {
31
32
  } = CONSTANTS;
32
33
  class Instrument extends _instrumentBase.InstrumentBase {
33
34
  static featureName = FEATURE_NAME;
34
- constructor(agentIdentifier, aggregator) {
35
- let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
35
+ constructor(agentIdentifier, aggregator, auto = true) {
36
36
  super(agentIdentifier, aggregator, FEATURE_NAME, auto);
37
37
  const canTrackSession = (0, _featureGates.canEnableSessionTracking)(this.agentIdentifier);
38
38
  if (!canTrackSession) {
@@ -40,8 +40,8 @@ class Instrument extends _instrumentBase.InstrumentBase {
40
40
  return;
41
41
  }
42
42
  const thisInstrumentEE = this.ee;
43
- (0, _wrap.wrapHistory)(thisInstrumentEE);
44
- this.eventsEE = (0, _wrap.wrapEvents)(thisInstrumentEE);
43
+ (0, _wrapHistory.wrapHistory)(thisInstrumentEE);
44
+ this.eventsEE = (0, _wrapEvents.wrapEvents)(thisInstrumentEE);
45
45
  this.eventsEE.on(FN_START, function (args, target) {
46
46
  this.bstStart = (0, _now.now)();
47
47
  });
@@ -77,4 +77,5 @@ class Instrument extends _instrumentBase.InstrumentBase {
77
77
  });
78
78
  }
79
79
  }
80
- exports.Instrument = Instrument;
80
+ exports.Instrument = Instrument;
81
+ const SessionTrace = exports.SessionTrace = Instrument;
@@ -22,7 +22,7 @@ class AjaxNode extends _belNode.BelNode {
22
22
  this.traceId = ajaxEvent.traceId;
23
23
  this.spanTimestamp = ajaxEvent.spanTimestamp;
24
24
  this.gql = ajaxEvent.gql;
25
- this.start = ajaxEvent.startTime;
25
+ this.start = ajaxEvent.startTime; // 5000 --- 5500 --> 10500
26
26
  this.end = ajaxEvent.endTime;
27
27
  }
28
28
  serialize(parentStartTimestamp) {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Aggregate = void 0;
7
- var _config = require("../../../common/config/config");
7
+ var _init = require("../../../common/config/init");
8
8
  var _drain = require("../../../common/drain/drain");
9
9
  var _handle = require("../../../common/event-emitter/handle");
10
10
  var _registerHandler = require("../../../common/event-emitter/register-handler");
@@ -14,30 +14,28 @@ var _timeToFirstByte = require("../../../common/vitals/time-to-first-byte");
14
14
  var _features = require("../../../loaders/features/features");
15
15
  var _constants = require("../../metrics/constants");
16
16
  var _aggregateBase = require("../../utils/aggregate-base");
17
+ var _eventBuffer = require("../../utils/event-buffer");
17
18
  var _constants2 = require("../constants");
18
19
  var _ajaxNode = require("./ajax-node");
19
20
  var _initialPageLoadInteraction = require("./initial-page-load-interaction");
20
21
  var _interaction = require("./interaction");
21
22
  class Aggregate extends _aggregateBase.AggregateBase {
22
23
  static featureName = _constants2.FEATURE_NAME;
23
- constructor(agentIdentifier, aggregator, _ref) {
24
- let {
25
- domObserver
26
- } = _ref;
24
+ constructor(agentIdentifier, aggregator, {
25
+ domObserver
26
+ }) {
27
27
  super(agentIdentifier, aggregator, _constants2.FEATURE_NAME);
28
- const harvestTimeSeconds = (0, _config.getConfigurationValue)(agentIdentifier, 'soft_navigations.harvestTimeSeconds') || 10;
29
- this.interactionsToHarvest = [];
30
- this.interactionsAwaitingRetry = [];
28
+ const harvestTimeSeconds = (0, _init.getConfigurationValue)(agentIdentifier, 'soft_navigations.harvestTimeSeconds') || 10;
29
+ this.interactionsToHarvest = new _eventBuffer.EventBuffer();
31
30
  this.domObserver = domObserver;
32
31
  this.initialPageLoadInteraction = new _initialPageLoadInteraction.InitialPageLoadInteraction(agentIdentifier);
33
- _timeToFirstByte.timeToFirstByte.subscribe(_ref2 => {
34
- let {
35
- attrs
36
- } = _ref2;
32
+ _timeToFirstByte.timeToFirstByte.subscribe(({
33
+ attrs
34
+ }) => {
37
35
  const loadEventTime = attrs.navigationEntry.loadEventEnd;
38
36
  this.initialPageLoadInteraction.forceSave = true;
39
37
  this.initialPageLoadInteraction.done(loadEventTime);
40
- this.interactionsToHarvest.push(this.initialPageLoadInteraction);
38
+ this.interactionsToHarvest.add(this.initialPageLoadInteraction);
41
39
  this.initialPageLoadInteraction = null;
42
40
  // Report metric on the initial page load time
43
41
  (0, _handle.handle)(_constants.SUPPORTABILITY_METRIC_CHANNEL, ['SoftNav/Interaction/InitialPageLoad/Duration/Ms', Math.round(loadEventTime)], undefined, _features.FEATURE_NAMES.metrics, this.ee);
@@ -46,8 +44,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
46
44
  this.interactionInProgress = null; // aside from the "page load" interaction, there can only ever be 1 ongoing at a time
47
45
 
48
46
  this.blocked = false;
49
- this.waitForFlags(['spa']).then(_ref3 => {
50
- let [spaOn] = _ref3;
47
+ this.waitForFlags(['spa']).then(([spaOn]) => {
51
48
  if (spaOn) {
52
49
  this.drain();
53
50
  const scheduler = new _harvestScheduler.HarvestScheduler('events', {
@@ -78,18 +75,17 @@ class Aggregate extends _aggregateBase.AggregateBase {
78
75
  (0, _registerHandler.registerHandler)('jserror', this.#handleJserror.bind(this), this.featureName, this.ee);
79
76
  }
80
77
  onHarvestStarted(options) {
81
- if (this.interactionsToHarvest.length === 0 || this.blocked) return;
78
+ if (!this.interactionsToHarvest.hasData || this.blocked) return;
82
79
  // The payload depacker takes the first ixn of a payload (if there are multiple ixns) and positively offset the subsequent ixns timestamps by that amount.
83
80
  // In order to accurately portray the real start & end times of the 2nd & onward ixns, we hence need to negatively offset their start timestamps with that of the 1st ixn.
84
81
  let firstIxnStartTime = 0; // the very 1st ixn does not require any offsetting
85
82
  const serializedIxnList = [];
86
- for (const interaction of this.interactionsToHarvest) {
83
+ for (const interaction of this.interactionsToHarvest.buffer) {
87
84
  serializedIxnList.push(interaction.serialize(firstIxnStartTime));
88
85
  if (!firstIxnStartTime) firstIxnStartTime = Math.floor(interaction.start);
89
86
  }
90
87
  const payload = "bel.7;".concat(serializedIxnList.join(';'));
91
- if (options.retry) this.interactionsAwaitingRetry = this.interactionsToHarvest;
92
- this.interactionsToHarvest = [];
88
+ if (options.retry) this.interactionsToHarvest.hold();else this.interactionsToHarvest.clear();
93
89
  return {
94
90
  body: {
95
91
  e: payload
@@ -97,10 +93,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
97
93
  };
98
94
  }
99
95
  onHarvestFinished(result) {
100
- if (result.sent && result.retry && this.interactionsAwaitingRetry.length > 0) {
101
- this.interactionsToHarvest = [...this.interactionsAwaitingRetry, ...this.interactionsToHarvest];
102
- }
103
- this.interactionsAwaitingRetry = [];
96
+ if (result.sent && result.retry && this.interactionsToHarvest.held.hasData) this.interactionsToHarvest.unhold();else this.interactionsToHarvest.held.clear();
104
97
  }
105
98
  startUIInteraction(eventName, startedAt, sourceElem) {
106
99
  // this is throttled by instrumentation so that it isn't excessively called
@@ -121,7 +114,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
121
114
  setClosureHandlers() {
122
115
  this.interactionInProgress.on('finished', () => {
123
116
  const ref = this.interactionInProgress;
124
- this.interactionsToHarvest.push(this.interactionInProgress);
117
+ this.interactionsToHarvest.add(this.interactionInProgress);
125
118
  this.interactionInProgress = null;
126
119
  this.domObserver.disconnect(); // can stop observing whenever our interaction logic completes a cycle
127
120
 
@@ -148,9 +141,9 @@ class Aggregate extends _aggregateBase.AggregateBase {
148
141
  */
149
142
  if (this.interactionInProgress?.isActiveDuring(timestamp)) return this.interactionInProgress;
150
143
  let saveIxn;
151
- for (let idx = this.interactionsToHarvest.length - 1; idx >= 0; idx--) {
144
+ for (let idx = this.interactionsToHarvest.buffer.length - 1; idx >= 0; idx--) {
152
145
  // reverse search for the latest completed interaction for efficiency
153
- const finishedInteraction = this.interactionsToHarvest[idx];
146
+ const finishedInteraction = this.interactionsToHarvest.buffer[idx];
154
147
  if (finishedInteraction.isActiveDuring(timestamp)) {
155
148
  if (finishedInteraction.trigger !== 'initialPageLoad') return finishedInteraction;
156
149
  // It's possible that a complete interaction occurs before page is fully loaded, so we need to consider if a route-change ixn may have overlapped this iPL
@@ -210,10 +203,9 @@ class Aggregate extends _aggregateBase.AggregateBase {
210
203
  #registerApiHandlers() {
211
204
  const INTERACTION_API = 'api-ixn-';
212
205
  const thisClass = this;
213
- (0, _registerHandler.registerHandler)(INTERACTION_API + 'get', function (time) {
214
- let {
215
- waitForEnd
216
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
206
+ (0, _registerHandler.registerHandler)(INTERACTION_API + 'get', function (time, {
207
+ waitForEnd
208
+ } = {}) {
217
209
  // In here, 'this' refers to the EventContext specific to per InteractionHandle instance spawned by each .interaction() api call.
218
210
  // Each api call aka IH instance would therefore retain a reference to either the in-progress interaction *at the time of the call* OR a new api-started interaction.
219
211
  this.associatedInteraction = thisClass.getInteractionFor(time);
@@ -9,11 +9,11 @@ var _interaction = require("./interaction");
9
9
  var _belSerializer = require("../../../common/serialize/bel-serializer");
10
10
  var _firstPaint = require("../../../common/vitals/first-paint");
11
11
  var _firstContentfulPaint = require("../../../common/vitals/first-contentful-paint");
12
- var _config = require("../../../common/config/config");
12
+ var _info = require("../../../common/config/info");
13
13
  class InitialPageLoadInteraction extends _interaction.Interaction {
14
14
  constructor(agentIdentifier) {
15
15
  super(agentIdentifier, 'initialPageLoad', 0, null);
16
- const agentInfo = (0, _config.getInfo)(agentIdentifier);
16
+ const agentInfo = (0, _info.getInfo)(agentIdentifier);
17
17
  this.queueTime = agentInfo.queueTime;
18
18
  this.appTime = agentInfo.applicationTime;
19
19
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Interaction = void 0;
7
- var _config = require("../../../common/config/config");
7
+ var _info = require("../../../common/config/info");
8
8
  var _runtime = require("../../../common/constants/runtime");
9
9
  var _uniqueId = require("../../../common/ids/unique-id");
10
10
  var _belSerializer = require("../../../common/serialize/bel-serializer");
@@ -70,13 +70,12 @@ class Interaction extends _belNode.BelNode {
70
70
  else this.#cancel();
71
71
  return true;
72
72
  }
73
- #finish() {
74
- let customEndTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
73
+ #finish(customEndTime = 0) {
75
74
  if (this.status !== _constants.INTERACTION_STATUS.IP) return; // disallow this call if the ixn is already done aka not in-progress
76
75
  clearTimeout(this.cancellationTimer);
77
76
  this.end = Math.max(this.domTimestamp, this.historyTimestamp, customEndTime);
78
77
  this.customAttributes = {
79
- ...(0, _config.getInfo)(this.agentIdentifier).jsAttributes,
78
+ ...(0, _info.getInfo)(this.agentIdentifier).jsAttributes,
80
79
  ...this.customAttributes
81
80
  }; // attrs specific to this interaction should have precedence over the general custom attrs
82
81
  this.status = _constants.INTERACTION_STATUS.FIN;
@@ -129,7 +128,7 @@ class Interaction extends _belNode.BelNode {
129
128
  // not relative
130
129
  addString(this.trigger), addString((0, _cleanUrl.cleanURL)(this.initialPageURL, true)), addString((0, _cleanUrl.cleanURL)(this.oldURL, true)), addString((0, _cleanUrl.cleanURL)(this.newURL, true)), addString(this.customName), ixnType, (0, _belSerializer.nullable)(this.queueTime, _belSerializer.numeric, true) + (0, _belSerializer.nullable)(this.appTime, _belSerializer.numeric, true) + (0, _belSerializer.nullable)(this.oldRoute, addString, true) + (0, _belSerializer.nullable)(this.newRoute, addString, true) + addString(this.id), addString(this.nodeId), (0, _belSerializer.nullable)(this.firstPaint, _belSerializer.numeric, true) + (0, _belSerializer.nullable)(this.firstContentfulPaint, _belSerializer.numeric)];
131
130
  const allAttachedNodes = (0, _belSerializer.addCustomAttributes)(this.customAttributes || {}, addString); // start with all custom attributes
132
- if ((0, _config.getInfo)(this.agentIdentifier).atts) allAttachedNodes.push('a,' + addString((0, _config.getInfo)(this.agentIdentifier).atts)); // add apm provided attributes
131
+ if ((0, _info.getInfo)(this.agentIdentifier).atts) allAttachedNodes.push('a,' + addString((0, _info.getInfo)(this.agentIdentifier).atts)); // add apm provided attributes
133
132
  /* Querypack encoder+decoder quirkiness:
134
133
  - If first ixn node of payload is being processed, we use this node's start to offset. (firstStartTime should be 0--or undefined.)
135
134
  - Else for subsequent ixn nodes, we use the first ixn node's start to offset. */