@newrelic/browser-agent 0.1.229 → 0.1.230
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/README.md +40 -1
- package/dist/cjs/common/config/state/configurable.js +2 -1
- package/dist/cjs/common/config/state/runtime.js +1 -0
- package/dist/cjs/common/constants/environment-variables.js +1 -1
- package/dist/cjs/common/context/shared-context.js +2 -1
- package/dist/cjs/common/drain/drain.js +9 -3
- package/dist/cjs/common/event-listener/event-listener-opts.js +4 -2
- package/dist/cjs/common/harvest/harvest-scheduler.js +2 -1
- package/dist/cjs/common/harvest/harvest.js +13 -2
- package/dist/cjs/common/util/console.js +1 -1
- package/dist/cjs/common/util/map-own.js +21 -14
- package/dist/cjs/common/util/map-own.test.js +49 -0
- package/dist/cjs/common/util/submit-data.js +11 -3
- package/dist/cjs/common/window/page-visibility.js +2 -1
- package/dist/cjs/common/window/session-storage.js +56 -11
- package/dist/cjs/common/wrap/index.js +11 -4
- package/dist/cjs/common/wrap/wrap-console.js +54 -0
- package/dist/cjs/common/wrap/wrap-events.js +4 -1
- package/dist/cjs/common/wrap/wrap-fetch.js +0 -2
- package/dist/cjs/common/wrap/wrap-function.js +4 -18
- package/dist/cjs/common/wrap/wrap-promise.js +4 -1
- package/dist/cjs/features/ajax/instrument/index.js +2 -1
- package/dist/cjs/features/jserrors/aggregate/canonical-function-name.test.js +5 -4
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.js +1 -2
- package/dist/cjs/features/jserrors/aggregate/format-stack-trace.test.js +5 -4
- package/dist/cjs/features/jserrors/aggregate/index.js +32 -11
- package/dist/cjs/features/jserrors/aggregate/string-hash-code.test.js +5 -4
- package/dist/cjs/features/jserrors/instrument/index.js +7 -10
- package/dist/cjs/features/metrics/aggregate/index.js +11 -0
- package/dist/cjs/features/metrics/instrument/index.js +27 -1
- package/dist/cjs/features/metrics/instrument/workers-helper.js +4 -1
- package/dist/cjs/features/page_action/aggregate/index.js +11 -3
- package/dist/cjs/features/page_action/instrument/index.js +2 -1
- package/dist/cjs/features/page_view_event/aggregate/index.js +8 -4
- package/dist/cjs/features/page_view_event/instrument/index.js +2 -1
- package/dist/cjs/features/page_view_timing/aggregate/index.js +54 -35
- package/dist/cjs/features/page_view_timing/instrument/index.js +2 -1
- package/dist/cjs/features/session_trace/aggregate/index.js +53 -13
- package/dist/cjs/features/session_trace/instrument/index.js +2 -1
- package/dist/cjs/features/spa/instrument/index.js +2 -1
- package/dist/cjs/features/utils/instrument-base.js +2 -1
- package/dist/cjs/index.js +9 -9
- package/dist/cjs/loaders/agent.js +2 -1
- package/dist/cjs/loaders/api/api.js +86 -21
- package/dist/cjs/loaders/api/apiAsync.js +3 -3
- package/dist/cjs/loaders/configure/configure.js +13 -7
- package/dist/cjs/loaders/micro-agent.js +18 -13
- package/dist/esm/common/config/state/configurable.js +2 -1
- package/dist/esm/common/config/state/runtime.js +1 -0
- package/dist/esm/common/constants/environment-variables.js +1 -1
- package/dist/esm/common/context/shared-context.js +2 -1
- package/dist/esm/common/drain/drain.js +9 -3
- package/dist/esm/common/event-listener/event-listener-opts.js +4 -2
- package/dist/esm/common/harvest/harvest-scheduler.js +2 -1
- package/dist/esm/common/harvest/harvest.js +13 -2
- package/dist/esm/common/util/console.js +1 -1
- package/dist/esm/common/util/map-own.js +19 -13
- package/dist/esm/common/util/map-own.test.js +47 -0
- package/dist/esm/common/util/submit-data.js +11 -3
- package/dist/esm/common/window/page-visibility.js +2 -1
- package/dist/esm/common/window/session-storage.js +54 -13
- package/dist/esm/common/wrap/index.js +5 -4
- package/dist/esm/common/wrap/wrap-console.js +46 -0
- package/dist/esm/common/wrap/wrap-events.js +5 -2
- package/dist/esm/common/wrap/wrap-fetch.js +1 -3
- package/dist/esm/common/wrap/wrap-function.js +4 -17
- package/dist/esm/common/wrap/wrap-history.js +1 -1
- package/dist/esm/common/wrap/wrap-jsonp.js +1 -1
- package/dist/esm/common/wrap/wrap-promise.js +4 -1
- package/dist/esm/common/wrap/wrap-raf.js +1 -1
- package/dist/esm/common/wrap/wrap-timer.js +1 -1
- package/dist/esm/common/wrap/wrap-xhr.js +2 -2
- package/dist/esm/features/ajax/instrument/index.js +2 -1
- package/dist/esm/features/jserrors/aggregate/canonical-function-name.test.js +5 -4
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.js +1 -2
- package/dist/esm/features/jserrors/aggregate/format-stack-trace.test.js +5 -4
- package/dist/esm/features/jserrors/aggregate/index.js +32 -11
- package/dist/esm/features/jserrors/aggregate/string-hash-code.test.js +5 -4
- package/dist/esm/features/jserrors/instrument/index.js +7 -10
- package/dist/esm/features/metrics/aggregate/index.js +11 -0
- package/dist/esm/features/metrics/instrument/index.js +27 -1
- package/dist/esm/features/metrics/instrument/workers-helper.js +4 -1
- package/dist/esm/features/page_action/aggregate/index.js +11 -3
- package/dist/esm/features/page_action/instrument/index.js +2 -1
- package/dist/esm/features/page_view_event/aggregate/index.js +8 -4
- package/dist/esm/features/page_view_event/instrument/index.js +2 -1
- package/dist/esm/features/page_view_timing/aggregate/index.js +54 -35
- package/dist/esm/features/page_view_timing/instrument/index.js +2 -1
- package/dist/esm/features/session_trace/aggregate/index.js +53 -13
- package/dist/esm/features/session_trace/instrument/index.js +2 -1
- package/dist/esm/features/spa/instrument/index.js +2 -1
- package/dist/esm/features/utils/instrument-base.js +2 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/loaders/agent.js +2 -1
- package/dist/esm/loaders/api/api.js +85 -21
- package/dist/esm/loaders/api/apiAsync.js +3 -3
- package/dist/esm/loaders/configure/configure.js +14 -8
- package/dist/esm/loaders/micro-agent.js +18 -13
- package/dist/types/cdn/lite.d.ts +2 -0
- package/dist/types/cdn/lite.d.ts.map +1 -0
- package/dist/types/cdn/polyfills/lite.d.ts +2 -0
- package/dist/types/cdn/polyfills/lite.d.ts.map +1 -0
- package/dist/types/cdn/polyfills/pro.d.ts +2 -0
- package/dist/types/cdn/polyfills/pro.d.ts.map +1 -0
- package/dist/types/cdn/polyfills/spa.d.ts +2 -0
- package/dist/types/cdn/polyfills/spa.d.ts.map +1 -0
- package/dist/types/cdn/polyfills.d.ts +2 -0
- package/dist/types/cdn/polyfills.d.ts.map +1 -0
- package/dist/types/cdn/pro.d.ts +2 -0
- package/dist/types/cdn/pro.d.ts.map +1 -0
- package/dist/types/cdn/spa.d.ts +2 -0
- package/dist/types/cdn/spa.d.ts.map +1 -0
- package/dist/types/cdn/worker.d.ts +2 -0
- package/dist/types/cdn/worker.d.ts.map +1 -0
- package/dist/types/common/aggregate/aggregator.d.ts +11 -0
- package/dist/types/common/aggregate/aggregator.d.ts.map +1 -0
- package/dist/types/common/browser-version/firefox-version.d.ts +2 -0
- package/dist/types/common/browser-version/firefox-version.d.ts.map +1 -0
- package/dist/types/common/browser-version/ios-version.d.ts +3 -0
- package/dist/types/common/browser-version/ios-version.d.ts.map +1 -0
- package/dist/types/common/config/config.d.ts +13 -0
- package/dist/types/common/config/config.d.ts.map +1 -0
- package/dist/types/common/config/state/configurable.d.ts +4 -0
- package/dist/types/common/config/state/configurable.d.ts.map +1 -0
- package/dist/types/common/config/state/info.d.ts +4 -0
- package/dist/types/common/config/state/info.d.ts.map +1 -0
- package/dist/types/common/config/state/init.d.ts +4 -0
- package/dist/types/common/config/state/init.d.ts.map +1 -0
- package/dist/types/common/config/state/loader-config.d.ts +3 -0
- package/dist/types/common/config/state/loader-config.d.ts.map +1 -0
- package/dist/types/common/config/state/originals.d.ts +2 -0
- package/dist/types/common/config/state/originals.d.ts.map +1 -0
- package/dist/types/common/config/state/runtime.d.ts +3 -0
- package/dist/types/common/config/state/runtime.d.ts.map +1 -0
- package/dist/types/common/constants/environment-variables.d.ts +4 -0
- package/dist/types/common/constants/environment-variables.d.ts.map +1 -0
- package/dist/types/common/context/shared-context.d.ts +5 -0
- package/dist/types/common/context/shared-context.d.ts.map +1 -0
- package/dist/types/common/deny-list/deny-list.d.ts +12 -0
- package/dist/types/common/deny-list/deny-list.d.ts.map +1 -0
- package/dist/types/common/drain/drain.d.ts +17 -0
- package/dist/types/common/drain/drain.d.ts.map +1 -0
- package/dist/types/common/event-emitter/contextual-ee.d.ts +4 -0
- package/dist/types/common/event-emitter/contextual-ee.d.ts.map +1 -0
- package/dist/types/common/event-emitter/handle.d.ts +3 -0
- package/dist/types/common/event-emitter/handle.d.ts.map +1 -0
- package/dist/types/common/event-emitter/register-handler.d.ts +8 -0
- package/dist/types/common/event-emitter/register-handler.d.ts.map +1 -0
- package/dist/types/common/event-listener/event-listener-opts.d.ts +10 -0
- package/dist/types/common/event-listener/event-listener-opts.d.ts.map +1 -0
- package/dist/types/common/harvest/harvest-scheduler.d.ts +21 -0
- package/dist/types/common/harvest/harvest-scheduler.d.ts.map +1 -0
- package/dist/types/common/harvest/harvest.d.ts +58 -0
- package/dist/types/common/harvest/harvest.d.ts.map +1 -0
- package/dist/types/common/ids/id.d.ts +2 -0
- package/dist/types/common/ids/id.d.ts.map +1 -0
- package/dist/types/common/ids/unique-id.d.ts +5 -0
- package/dist/types/common/ids/unique-id.d.ts.map +1 -0
- package/dist/types/common/metrics/framework-detection.d.ts +2 -0
- package/dist/types/common/metrics/framework-detection.d.ts.map +1 -0
- package/dist/types/common/metrics/paint-metrics.d.ts +2 -0
- package/dist/types/common/metrics/paint-metrics.d.ts.map +1 -0
- package/dist/types/common/serialize/bel-serializer.d.ts +5 -0
- package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -0
- package/dist/types/common/timing/nav-timing.d.ts +5 -0
- package/dist/types/common/timing/nav-timing.d.ts.map +1 -0
- package/dist/types/common/timing/now.d.ts +2 -0
- package/dist/types/common/timing/now.d.ts.map +1 -0
- package/dist/types/common/unload/eol.d.ts +8 -0
- package/dist/types/common/unload/eol.d.ts.map +1 -0
- package/dist/types/common/url/clean-url.d.ts +2 -0
- package/dist/types/common/url/clean-url.d.ts.map +1 -0
- package/dist/types/common/url/encode.d.ts +5 -0
- package/dist/types/common/url/encode.d.ts.map +1 -0
- package/dist/types/common/url/location.d.ts +2 -0
- package/dist/types/common/url/location.d.ts.map +1 -0
- package/dist/types/common/url/parse-url.d.ts +2 -0
- package/dist/types/common/url/parse-url.d.ts.map +1 -0
- package/dist/types/common/url/protocol.d.ts +7 -0
- package/dist/types/common/url/protocol.d.ts.map +1 -0
- package/dist/types/common/util/console.d.ts +8 -0
- package/dist/types/common/util/console.d.ts.map +1 -0
- package/dist/types/common/util/data-size.d.ts +2 -0
- package/dist/types/common/util/data-size.d.ts.map +1 -0
- package/dist/types/common/util/feature-flags.d.ts +3 -0
- package/dist/types/common/util/feature-flags.d.ts.map +1 -0
- package/dist/types/common/util/get-or-set.d.ts +2 -0
- package/dist/types/common/util/get-or-set.d.ts.map +1 -0
- package/dist/types/common/util/global-scope.d.ts +13 -0
- package/dist/types/common/util/global-scope.d.ts.map +1 -0
- package/dist/types/common/util/map-own.d.ts +3 -0
- package/dist/types/common/util/map-own.d.ts.map +1 -0
- package/dist/types/common/util/obfuscate.d.ts +8 -0
- package/dist/types/common/util/obfuscate.d.ts.map +1 -0
- package/dist/types/common/util/s-hash.d.ts +2 -0
- package/dist/types/common/util/s-hash.d.ts.map +1 -0
- package/dist/types/common/util/single.d.ts +2 -0
- package/dist/types/common/util/single.d.ts.map +1 -0
- package/dist/types/common/util/stringify.d.ts +8 -0
- package/dist/types/common/util/stringify.d.ts.map +1 -0
- package/dist/types/common/util/submit-data.d.ts +35 -0
- package/dist/types/common/util/submit-data.d.ts.map +1 -0
- package/dist/types/common/util/traverse.d.ts +2 -0
- package/dist/types/common/util/traverse.d.ts.map +1 -0
- package/dist/types/common/util/user-agent.d.ts +5 -0
- package/dist/types/common/util/user-agent.d.ts.map +1 -0
- package/dist/types/common/window/load.d.ts +3 -0
- package/dist/types/common/window/load.d.ts.map +1 -0
- package/dist/types/common/window/nreum.d.ts +14 -0
- package/dist/types/common/window/nreum.d.ts.map +1 -0
- package/dist/types/common/window/page-visibility.d.ts +7 -0
- package/dist/types/common/window/page-visibility.d.ts.map +1 -0
- package/dist/types/common/window/session-storage.d.ts +18 -0
- package/dist/types/common/window/session-storage.d.ts.map +1 -0
- package/dist/types/common/window/supports-performance-observer.d.ts +2 -0
- package/dist/types/common/window/supports-performance-observer.d.ts.map +1 -0
- package/dist/types/common/wrap/index.d.ts +12 -0
- package/dist/types/common/wrap/index.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-console.d.ts +16 -0
- package/dist/types/common/wrap/wrap-console.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-events.d.ts +17 -0
- package/dist/types/common/wrap/wrap-events.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-fetch.d.ts +18 -0
- package/dist/types/common/wrap/wrap-fetch.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-function.d.ts +28 -0
- package/dist/types/common/wrap/wrap-function.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-history.d.ts +16 -0
- package/dist/types/common/wrap/wrap-history.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-jsonp.d.ts +16 -0
- package/dist/types/common/wrap/wrap-jsonp.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-mutation.d.ts +16 -0
- package/dist/types/common/wrap/wrap-mutation.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-promise.d.ts +17 -0
- package/dist/types/common/wrap/wrap-promise.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-raf.d.ts +16 -0
- package/dist/types/common/wrap/wrap-raf.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-timer.d.ts +17 -0
- package/dist/types/common/wrap/wrap-timer.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-xhr.d.ts +16 -0
- package/dist/types/common/wrap/wrap-xhr.d.ts.map +1 -0
- package/dist/types/features/ajax/aggregate/index.d.ts +16 -0
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/ajax/constants.d.ts +2 -0
- package/dist/types/features/ajax/constants.d.ts.map +1 -0
- package/dist/types/features/ajax/index.d.ts +2 -0
- package/dist/types/features/ajax/index.d.ts.map +1 -0
- package/dist/types/features/ajax/instrument/distributed-tracing.d.ts +19 -0
- package/dist/types/features/ajax/instrument/distributed-tracing.d.ts.map +1 -0
- package/dist/types/features/ajax/instrument/index.d.ts +9 -0
- package/dist/types/features/ajax/instrument/index.d.ts.map +1 -0
- package/dist/types/features/ajax/instrument/response-size.d.ts +2 -0
- package/dist/types/features/ajax/instrument/response-size.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/canonical-function-name.d.ts +2 -0
- package/dist/types/features/jserrors/aggregate/canonical-function-name.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/compute-stack-trace.d.ts +22 -0
- package/dist/types/features/jserrors/aggregate/compute-stack-trace.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/format-stack-trace.d.ts +3 -0
- package/dist/types/features/jserrors/aggregate/format-stack-trace.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts +24 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/string-hash-code.d.ts +2 -0
- package/dist/types/features/jserrors/aggregate/string-hash-code.d.ts.map +1 -0
- package/dist/types/features/jserrors/constants.d.ts +3 -0
- package/dist/types/features/jserrors/constants.d.ts.map +1 -0
- package/dist/types/features/jserrors/index.d.ts +2 -0
- package/dist/types/features/jserrors/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/instrument/debug.d.ts +2 -0
- package/dist/types/features/jserrors/instrument/debug.d.ts.map +1 -0
- package/dist/types/features/jserrors/instrument/index.d.ts +22 -0
- package/dist/types/features/jserrors/instrument/index.d.ts.map +1 -0
- package/dist/types/features/metrics/aggregate/index.d.ts +12 -0
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/metrics/constants.d.ts +6 -0
- package/dist/types/features/metrics/constants.d.ts.map +1 -0
- package/dist/types/features/metrics/index.d.ts +2 -0
- package/dist/types/features/metrics/index.d.ts.map +1 -0
- package/dist/types/features/metrics/instrument/index.d.ts +7 -0
- package/dist/types/features/metrics/instrument/index.d.ts.map +1 -0
- package/dist/types/features/metrics/instrument/workers-helper.d.ts +7 -0
- package/dist/types/features/metrics/instrument/workers-helper.d.ts.map +1 -0
- package/dist/types/features/page_action/aggregate/index.d.ts +24 -0
- package/dist/types/features/page_action/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/page_action/constants.d.ts +2 -0
- package/dist/types/features/page_action/constants.d.ts.map +1 -0
- package/dist/types/features/page_action/index.d.ts +2 -0
- package/dist/types/features/page_action/index.d.ts.map +1 -0
- package/dist/types/features/page_action/instrument/index.d.ts +6 -0
- package/dist/types/features/page_action/instrument/index.d.ts.map +1 -0
- package/dist/types/features/page_view_event/aggregate/index.d.ts +9 -0
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts +8 -0
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts.map +1 -0
- package/dist/types/features/page_view_event/constants.d.ts +5 -0
- package/dist/types/features/page_view_event/constants.d.ts.map +1 -0
- package/dist/types/features/page_view_event/index.d.ts +2 -0
- package/dist/types/features/page_view_event/index.d.ts.map +1 -0
- package/dist/types/features/page_view_event/instrument/index.d.ts +6 -0
- package/dist/types/features/page_view_event/instrument/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +33 -0
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/constants.d.ts +2 -0
- package/dist/types/features/page_view_timing/constants.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/first-paint.d.ts +2 -0
- package/dist/types/features/page_view_timing/first-paint.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/index.d.ts +2 -0
- package/dist/types/features/page_view_timing/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/instrument/index.d.ts +6 -0
- package/dist/types/features/page_view_timing/instrument/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/long-tasks.d.ts +2 -0
- package/dist/types/features/page_view_timing/long-tasks.d.ts.map +1 -0
- package/dist/types/features/session_trace/aggregate/index.d.ts +77 -0
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/session_trace/constants.d.ts +13 -0
- package/dist/types/features/session_trace/constants.d.ts.map +1 -0
- package/dist/types/features/session_trace/index.d.ts +2 -0
- package/dist/types/features/session_trace/index.d.ts.map +1 -0
- package/dist/types/features/session_trace/instrument/index.d.ts +11 -0
- package/dist/types/features/session_trace/instrument/index.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/index.d.ts +25 -0
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/interaction-node.d.ts +15 -0
- package/dist/types/features/spa/aggregate/interaction-node.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/interaction.d.ts +20 -0
- package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/serializer.d.ts +15 -0
- package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -0
- package/dist/types/features/spa/constants.d.ts +23 -0
- package/dist/types/features/spa/constants.d.ts.map +1 -0
- package/dist/types/features/spa/index.d.ts +2 -0
- package/dist/types/features/spa/index.d.ts.map +1 -0
- package/dist/types/features/spa/instrument/index.d.ts +8 -0
- package/dist/types/features/spa/instrument/index.d.ts.map +1 -0
- package/dist/types/features/utils/aggregate-base.d.ts +4 -0
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -0
- package/dist/types/features/utils/feature-base.d.ts +23 -0
- package/dist/types/features/utils/feature-base.d.ts.map +1 -0
- package/dist/types/features/utils/handler-cache.d.ts +22 -0
- package/dist/types/features/utils/handler-cache.d.ts.map +1 -0
- package/dist/types/features/utils/instrument-base.d.ts +27 -0
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -0
- package/dist/types/features/utils/lazy-loader.d.ts +13 -0
- package/dist/types/features/utils/lazy-loader.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/loaders/agent.d.ts +20 -0
- package/dist/types/loaders/agent.d.ts.map +1 -0
- package/dist/types/loaders/api/api.d.ts +17 -0
- package/dist/types/loaders/api/api.d.ts.map +1 -0
- package/dist/types/loaders/api/apiAsync.d.ts +2 -0
- package/dist/types/loaders/api/apiAsync.d.ts.map +1 -0
- package/dist/types/loaders/browser-agent.d.ts +9 -0
- package/dist/types/loaders/browser-agent.d.ts.map +1 -0
- package/dist/types/loaders/configure/configure.d.ts +10 -0
- package/dist/types/loaders/configure/configure.d.ts.map +1 -0
- package/dist/types/loaders/features/enabled-features.d.ts +2 -0
- package/dist/types/loaders/features/enabled-features.d.ts.map +1 -0
- package/dist/types/loaders/features/featureDependencies.d.ts +3 -0
- package/dist/types/loaders/features/featureDependencies.d.ts.map +1 -0
- package/dist/types/loaders/features/features.d.ts +18 -0
- package/dist/types/loaders/features/features.d.ts.map +1 -0
- package/dist/types/loaders/micro-agent.d.ts +25 -0
- package/dist/types/loaders/micro-agent.d.ts.map +1 -0
- package/dist/types/loaders/worker-agent.d.ts +8 -0
- package/dist/types/loaders/worker-agent.d.ts.map +1 -0
- package/package.json +61 -32
- package/src/cdn/lite.js +18 -0
- package/src/cdn/polyfills/lite.js +7 -0
- package/src/cdn/polyfills/pro.js +7 -0
- package/src/cdn/polyfills/spa.js +7 -0
- package/src/cdn/polyfills.js +17 -0
- package/src/cdn/pro.js +27 -0
- package/src/cdn/spa.js +28 -0
- package/src/cdn/worker.js +21 -0
- package/src/common/aggregate/aggregator.js +171 -0
- package/src/common/browser-version/firefox-version.js +10 -0
- package/src/common/browser-version/ios-version.js +10 -0
- package/src/common/config/config.js +12 -0
- package/src/common/config/state/configurable.js +26 -0
- package/src/common/config/state/info.js +49 -0
- package/src/common/config/state/init.js +56 -0
- package/src/common/config/state/loader-config.js +25 -0
- package/src/common/config/state/originals.js +3 -0
- package/src/common/config/state/runtime.js +45 -0
- package/src/common/constants/environment-variables.js +11 -0
- package/src/common/context/shared-context.js +21 -0
- package/src/common/deny-list/deny-list.js +116 -0
- package/src/common/drain/drain.js +119 -0
- package/src/common/event-emitter/contextual-ee.js +159 -0
- package/src/common/event-emitter/handle.js +17 -0
- package/src/common/event-emitter/register-handler.js +25 -0
- package/src/common/event-listener/event-listener-opts.js +41 -0
- package/src/common/harvest/harvest-scheduler.js +112 -0
- package/src/common/harvest/harvest.js +248 -0
- package/src/common/ids/id.js +23 -0
- package/src/common/ids/unique-id.js +81 -0
- package/src/common/metrics/framework-detection.js +71 -0
- package/src/common/metrics/paint-metrics.js +6 -0
- package/src/common/serialize/bel-serializer.js +93 -0
- package/src/common/timing/nav-timing.js +70 -0
- package/src/common/timing/now.js +9 -0
- package/src/common/unload/eol.js +63 -0
- package/src/common/url/clean-url.js +10 -0
- package/src/common/url/encode.js +75 -0
- package/src/common/url/location.js +8 -0
- package/src/common/url/parse-url.js +71 -0
- package/src/common/url/protocol.js +19 -0
- package/src/common/util/console.js +11 -0
- package/src/common/util/data-size.js +21 -0
- package/src/common/util/feature-flags.js +38 -0
- package/src/common/util/get-or-set.js +34 -0
- package/src/common/util/global-scope.js +48 -0
- package/src/common/util/map-own.js +22 -0
- package/src/common/util/map-own.test.js +52 -0
- package/src/common/util/obfuscate.js +73 -0
- package/src/common/util/s-hash.js +14 -0
- package/src/common/util/single.js +18 -0
- package/src/common/util/stringify.js +42 -0
- package/src/common/util/submit-data.js +101 -0
- package/src/common/util/traverse.js +36 -0
- package/src/common/util/user-agent.js +56 -0
- package/src/common/window/load.js +15 -0
- package/src/common/window/nreum.js +110 -0
- package/src/common/window/page-visibility.js +24 -0
- package/src/common/window/session-storage.js +75 -0
- package/src/common/window/supports-performance-observer.js +10 -0
- package/src/common/wrap/index.js +18 -0
- package/src/common/wrap/wrap-console.js +47 -0
- package/src/common/wrap/wrap-events.js +106 -0
- package/src/common/wrap/wrap-fetch.js +109 -0
- package/src/common/wrap/wrap-function.js +248 -0
- package/src/common/wrap/wrap-history.js +48 -0
- package/src/common/wrap/wrap-jsonp.js +134 -0
- package/src/common/wrap/wrap-mutation.js +55 -0
- package/src/common/wrap/wrap-promise.js +165 -0
- package/src/common/wrap/wrap-raf.js +50 -0
- package/src/common/wrap/wrap-timer.js +67 -0
- package/src/common/wrap/wrap-xhr.js +213 -0
- package/src/features/ajax/aggregate/index.js +248 -0
- package/src/features/ajax/constants.js +3 -0
- package/src/features/ajax/index.js +1 -0
- package/src/features/ajax/instrument/distributed-tracing.js +166 -0
- package/src/features/ajax/instrument/index.js +380 -0
- package/src/features/ajax/instrument/response-size.js +18 -0
- package/src/features/jserrors/aggregate/canonical-function-name.js +14 -0
- package/src/features/jserrors/aggregate/canonical-function-name.test.js +13 -0
- package/src/features/jserrors/aggregate/compute-stack-trace.js +231 -0
- package/src/features/jserrors/aggregate/compute-stack-trace.test.js +297 -0
- package/src/features/jserrors/aggregate/format-stack-trace.js +30 -0
- package/src/features/jserrors/aggregate/format-stack-trace.test.js +39 -0
- package/src/features/jserrors/aggregate/index.js +310 -0
- package/src/features/jserrors/aggregate/string-hash-code.js +17 -0
- package/src/features/jserrors/aggregate/string-hash-code.test.js +12 -0
- package/src/features/jserrors/constants.js +4 -0
- package/src/features/jserrors/index.js +1 -0
- package/src/features/jserrors/instrument/debug.js +36 -0
- package/src/features/jserrors/instrument/index.js +149 -0
- package/src/features/metrics/aggregate/index.js +134 -0
- package/src/features/metrics/constants.js +7 -0
- package/src/features/metrics/index.js +1 -0
- package/src/features/metrics/instrument/index.js +44 -0
- package/src/features/metrics/instrument/workers-helper.js +110 -0
- package/src/features/page_action/aggregate/index.js +113 -0
- package/src/features/page_action/constants.js +3 -0
- package/src/features/page_action/index.js +1 -0
- package/src/features/page_action/instrument/index.js +15 -0
- package/src/features/page_view_event/aggregate/index.js +134 -0
- package/src/features/page_view_event/aggregate/initialized-features.js +31 -0
- package/src/features/page_view_event/constants.js +6 -0
- package/src/features/page_view_event/index.js +1 -0
- package/src/features/page_view_event/instrument/index.js +33 -0
- package/src/features/page_view_timing/aggregate/index.js +246 -0
- package/src/features/page_view_timing/constants.js +3 -0
- package/src/features/page_view_timing/first-paint.js +41 -0
- package/src/features/page_view_timing/index.js +1 -0
- package/src/features/page_view_timing/instrument/index.js +30 -0
- package/src/features/page_view_timing/long-tasks.js +60 -0
- package/src/features/session_trace/aggregate/index.js +410 -0
- package/src/features/session_trace/constants.js +15 -0
- package/src/features/session_trace/index.js +1 -0
- package/src/features/session_trace/instrument/index.js +126 -0
- package/src/features/spa/aggregate/index.js +738 -0
- package/src/features/spa/aggregate/interaction-node.js +85 -0
- package/src/features/spa/aggregate/interaction-node.test.js +17 -0
- package/src/features/spa/aggregate/interaction.js +112 -0
- package/src/features/spa/aggregate/serializer.js +198 -0
- package/src/features/spa/constants.js +36 -0
- package/src/features/spa/index.js +1 -0
- package/src/features/spa/instrument/index.js +112 -0
- package/src/features/utils/aggregate-base.js +7 -0
- package/src/features/utils/feature-base.js +51 -0
- package/src/features/utils/handler-cache.js +60 -0
- package/src/features/utils/instrument-base.js +68 -0
- package/src/features/utils/lazy-loader.js +37 -0
- package/src/index.js +15 -0
- package/src/loaders/agent.js +80 -0
- package/src/loaders/api/api.js +175 -0
- package/src/loaders/api/apiAsync.js +92 -0
- package/src/loaders/browser-agent.js +33 -0
- package/src/loaders/configure/configure.js +39 -0
- package/src/loaders/features/enabled-features.js +16 -0
- package/src/loaders/features/featureDependencies.js +26 -0
- package/src/loaders/features/features.js +25 -0
- package/src/loaders/micro-agent.js +84 -0
- package/src/loaders/worker-agent.js +24 -0
- package/dist/cjs/common/util/reduce.js +0 -22
- package/dist/cjs/common/window/top-level-callers.js +0 -23
- package/dist/esm/common/util/reduce.js +0 -16
- package/dist/esm/common/window/top-level-callers.js +0 -17
- package/types.ts +0 -221
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.computeStackTrace = computeStackTrace;
|
|
7
|
-
var _reduce = require("../../../common/util/reduce");
|
|
8
7
|
var _formatStackTrace = require("./format-stack-trace");
|
|
9
8
|
/*
|
|
10
9
|
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
@@ -120,7 +119,7 @@ function computeStackTraceFromStackProp(ex) {
|
|
|
120
119
|
if (!ex.stack) {
|
|
121
120
|
return null;
|
|
122
121
|
}
|
|
123
|
-
var errorInfo =
|
|
122
|
+
var errorInfo = ex.stack.split('\n').reduce(parseStackProp, {
|
|
124
123
|
frames: [],
|
|
125
124
|
stackLines: [],
|
|
126
125
|
wrapperSeen: false
|
|
@@ -15,10 +15,11 @@ describe('formatStackTrace', () => {
|
|
|
15
15
|
input: ['line 1', 'line 2', ''],
|
|
16
16
|
expected: 'line 1\nline 2',
|
|
17
17
|
title: 'Strips ending empty stack frame'
|
|
18
|
-
}])('$title',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
}])('$title', _ref => {
|
|
19
|
+
let {
|
|
20
|
+
input,
|
|
21
|
+
expected
|
|
22
|
+
} = _ref;
|
|
22
23
|
const result = (0, _formatStackTrace.formatStackTrace)(input);
|
|
23
24
|
expect(result).toEqual(expected);
|
|
24
25
|
});
|
|
@@ -21,7 +21,6 @@ var _aggregateBase = require("../../utils/aggregate-base");
|
|
|
21
21
|
var _constants = require("../constants");
|
|
22
22
|
var _drain = require("../../../common/drain/drain");
|
|
23
23
|
var _features = require("../../../loaders/features/features");
|
|
24
|
-
var _load = require("../../../common/window/load");
|
|
25
24
|
/*
|
|
26
25
|
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
27
26
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -30,7 +29,9 @@ var _load = require("../../../common/window/load");
|
|
|
30
29
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
31
30
|
static featureName = _constants.FEATURE_NAME;
|
|
32
31
|
constructor(agentIdentifier, aggregator) {
|
|
32
|
+
var _this;
|
|
33
33
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME);
|
|
34
|
+
_this = this;
|
|
34
35
|
this.stackReported = {};
|
|
35
36
|
this.pageviewReported = {};
|
|
36
37
|
this.errorCache = {};
|
|
@@ -42,13 +43,21 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
42
43
|
|
|
43
44
|
// this will need to change to match whatever ee we use in the instrument
|
|
44
45
|
this.ee.on('interactionDiscarded', interaction => this.onInteractionDiscarded(interaction));
|
|
45
|
-
(0, _registerHandler.registerHandler)('err',
|
|
46
|
-
|
|
46
|
+
(0, _registerHandler.registerHandler)('err', function () {
|
|
47
|
+
return _this.storeError(...arguments);
|
|
48
|
+
}, this.featureName, this.ee);
|
|
49
|
+
(0, _registerHandler.registerHandler)('ierr', function () {
|
|
50
|
+
return _this.storeError(...arguments);
|
|
51
|
+
}, this.featureName, this.ee);
|
|
47
52
|
const harvestTimeSeconds = (0, _config.getConfigurationValue)(this.agentIdentifier, 'jserrors.harvestTimeSeconds') || 10;
|
|
48
53
|
const scheduler = new _harvestScheduler.HarvestScheduler('jserrors', {
|
|
49
|
-
onFinished: (
|
|
54
|
+
onFinished: function () {
|
|
55
|
+
return _this.onHarvestFinished(...arguments);
|
|
56
|
+
}
|
|
50
57
|
}, this);
|
|
51
|
-
scheduler.harvest.on('jserrors', (
|
|
58
|
+
scheduler.harvest.on('jserrors', function () {
|
|
59
|
+
return _this.onHarvestStarted(...arguments);
|
|
60
|
+
});
|
|
52
61
|
|
|
53
62
|
// Don't start harvesting until "drain" for this feat has been called (which currently requires RUM response).
|
|
54
63
|
this.ee.on(`drain-${this.featureName}`, () => {
|
|
@@ -147,17 +156,29 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
147
156
|
storeError(err, time, internal, customAttributes) {
|
|
148
157
|
// are we in an interaction
|
|
149
158
|
time = time || (0, _now.now)();
|
|
150
|
-
|
|
159
|
+
const agentRuntime = (0, _config.getRuntime)(this.agentIdentifier);
|
|
160
|
+
let filterOutput;
|
|
161
|
+
if (!internal && agentRuntime.onerror) {
|
|
162
|
+
filterOutput = agentRuntime.onerror(err);
|
|
163
|
+
if (filterOutput && !(typeof filterOutput.group === 'string' && filterOutput.group.length)) {
|
|
164
|
+
// All truthy values mean don't report (store) the error, per backwards-compatible usage,
|
|
165
|
+
// - EXCEPT if a fingerprinting label is returned, via an object with key of 'group' and value of non-empty string
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
// Again as with previous usage, all falsey values would include the error.
|
|
169
|
+
}
|
|
170
|
+
|
|
151
171
|
var stackInfo = this.canonicalizeStackURLs((0, _computeStackTrace.computeStackTrace)(err));
|
|
152
172
|
var canonicalStack = this.buildCanonicalStackString(stackInfo);
|
|
153
|
-
|
|
173
|
+
const params = {
|
|
154
174
|
stackHash: (0, _stringHashCode.stringHashCode)(canonicalStack),
|
|
155
175
|
exceptionClass: stackInfo.name,
|
|
156
176
|
request_uri: _globalScope.globalScope?.location.pathname
|
|
157
177
|
};
|
|
158
|
-
if (stackInfo.message)
|
|
159
|
-
|
|
160
|
-
|
|
178
|
+
if (stackInfo.message) params.message = '' + stackInfo.message;
|
|
179
|
+
// Notice if filterOutput isn't false|undefined OR our specified object, this func would've returned already (so it's unnecessary to req-check group).
|
|
180
|
+
// Do not modify the name ('errorGroup') of params without DEM approval!
|
|
181
|
+
if (filterOutput?.group) params.errorGroup = filterOutput.group;
|
|
161
182
|
|
|
162
183
|
/**
|
|
163
184
|
* The bucketHash is different from the params.stackHash because the params.stackHash is based on the canonicalized
|
|
@@ -172,7 +193,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
172
193
|
} else {
|
|
173
194
|
params.browser_stack_hash = (0, _stringHashCode.stringHashCode)(stackInfo.stackString);
|
|
174
195
|
}
|
|
175
|
-
params.releaseIds = (0, _stringify.stringify)(
|
|
196
|
+
params.releaseIds = (0, _stringify.stringify)(agentRuntime.releaseIds);
|
|
176
197
|
|
|
177
198
|
// When debugging stack canonicalization/hashing, uncomment these lines for
|
|
178
199
|
// more output in the test logs
|
|
@@ -17,10 +17,11 @@ test.each([{
|
|
|
17
17
|
input: 'lksjdflksjdf',
|
|
18
18
|
expected: 32668720,
|
|
19
19
|
title: 'Return valid hash of string'
|
|
20
|
-
}])('$title',
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
}])('$title', _ref => {
|
|
21
|
+
let {
|
|
22
|
+
input,
|
|
23
|
+
expected
|
|
24
|
+
} = _ref;
|
|
24
25
|
const result = (0, _stringHashCode.stringHashCode)(input);
|
|
25
26
|
expect(result).toEqual(expected);
|
|
26
27
|
});
|
|
@@ -25,12 +25,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
25
25
|
|
|
26
26
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
27
27
|
static featureName = _constants.FEATURE_NAME;
|
|
28
|
-
constructor(agentIdentifier, aggregator
|
|
28
|
+
constructor(agentIdentifier, aggregator) {
|
|
29
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
29
30
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|
|
30
31
|
// skipNext counter to keep track of uncaught
|
|
31
32
|
// errors that will be the same as caught errors.
|
|
32
33
|
this.skipNext = 0;
|
|
33
|
-
this.origOnerror = _globalScope.globalScope.onerror;
|
|
34
34
|
try {
|
|
35
35
|
this.removeOnAbort = new AbortController();
|
|
36
36
|
} // this try-catch can be removed when IE11 is completely unsupported & gone
|
|
@@ -56,12 +56,9 @@ class Instrument extends _instrumentBase.InstrumentBase {
|
|
|
56
56
|
(0, _handle.handle)('ierr', [e, (0, _now.now)(), true], undefined, _features.FEATURE_NAMES.jserrors, thisInstrument.ee);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
//
|
|
60
|
-
_globalScope.globalScope.onerror
|
|
61
|
-
|
|
62
|
-
this.onerrorHandler(...args);
|
|
63
|
-
return false;
|
|
64
|
-
};
|
|
59
|
+
// Replace global error handler with our own.
|
|
60
|
+
this.origOnerror = _globalScope.globalScope.onerror;
|
|
61
|
+
_globalScope.globalScope.onerror = this.onerrorHandler.bind(this);
|
|
65
62
|
_globalScope.globalScope.addEventListener('unhandledrejection', e => {
|
|
66
63
|
/** rejections can contain data of any type -- this is an effort to keep the message human readable */
|
|
67
64
|
const err = castReasonToError(e.reason);
|
|
@@ -94,6 +91,7 @@ class Instrument extends _instrumentBase.InstrumentBase {
|
|
|
94
91
|
* @returns
|
|
95
92
|
*/
|
|
96
93
|
onerrorHandler(message, filename, lineno, column, errorObj) {
|
|
94
|
+
if (typeof this.origOnerror === 'function') this.origOnerror(...arguments);
|
|
97
95
|
try {
|
|
98
96
|
if (this.skipNext) this.skipNext -= 1;else notice(errorObj || new UncaughtException(message, filename, lineno), true, this.ee);
|
|
99
97
|
} catch (e) {
|
|
@@ -103,8 +101,7 @@ class Instrument extends _instrumentBase.InstrumentBase {
|
|
|
103
101
|
// do nothing
|
|
104
102
|
}
|
|
105
103
|
}
|
|
106
|
-
|
|
107
|
-
return false;
|
|
104
|
+
return false; // maintain default behavior of the error event of Window
|
|
108
105
|
}
|
|
109
106
|
}
|
|
110
107
|
|
|
@@ -109,6 +109,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
109
109
|
// TODO - these SMs are to be removed when we implement the actual resources feature
|
|
110
110
|
try {
|
|
111
111
|
if (this.resourcesSent) return;
|
|
112
|
+
const agentRuntime = (0, _config.getRuntime)(this.agentIdentifier);
|
|
112
113
|
// make sure this only gets sent once
|
|
113
114
|
this.resourcesSent = true;
|
|
114
115
|
// differentiate between internal+external and ajax+non-ajax
|
|
@@ -128,6 +129,16 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
128
129
|
if (isAjax(entry)) this.storeSupportabilityMetrics('Generic/Resources/Ajax/External');else this.storeSupportabilityMetrics('Generic/Resources/Non-Ajax/External');
|
|
129
130
|
}
|
|
130
131
|
});
|
|
132
|
+
|
|
133
|
+
// Capture per-agent bytes sent for each endpoint (see harvest) and RUM call (see page_view_event aggregator).
|
|
134
|
+
Object.keys(agentRuntime.bytesSent).forEach(endpoint => {
|
|
135
|
+
this.storeSupportabilityMetrics(`PageSession/Endpoint/${endpoint.charAt(0).toUpperCase() + endpoint.slice(1)}/BytesSent`, agentRuntime.bytesSent[endpoint]);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Capture metrics for session trace if active (`ptid` is set when returned by replay ingest).
|
|
139
|
+
if (agentRuntime.ptid) {
|
|
140
|
+
this.storeSupportabilityMetrics('PageSession/Feature/SessionTrace/DurationMs', Math.round(performance.now()));
|
|
141
|
+
}
|
|
131
142
|
} catch (e) {
|
|
132
143
|
// do nothing
|
|
133
144
|
}
|
|
@@ -9,12 +9,38 @@ var _workersHelper = require("./workers-helper");
|
|
|
9
9
|
var _constants = require("../constants");
|
|
10
10
|
var _handle = require("../../../common/event-emitter/handle");
|
|
11
11
|
var _features = require("../../../loaders/features/features");
|
|
12
|
+
var _wrap = require("../../../common/wrap");
|
|
13
|
+
var _stringify = require("../../../common/util/stringify");
|
|
12
14
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
13
15
|
static featureName = _constants.FEATURE_NAME;
|
|
14
|
-
constructor(agentIdentifier, aggregator
|
|
16
|
+
constructor(agentIdentifier, aggregator) {
|
|
17
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
15
18
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|
|
16
19
|
(0, _workersHelper.insertSupportMetrics)(tag => (0, _handle.handle)(_constants.SUPPORTABILITY_METRIC_CHANNEL, [tag], undefined, _features.FEATURE_NAMES.metrics, this.ee));
|
|
20
|
+
this.addConsoleSupportabilityMetrics();
|
|
17
21
|
this.importAggregator();
|
|
18
22
|
}
|
|
23
|
+
addConsoleSupportabilityMetrics() {
|
|
24
|
+
// For now we are just capturing supportability metrics on `console` usage to assess log forwarding feature.
|
|
25
|
+
const consoleEE = (0, _wrap.wrapConsole)(this.ee);
|
|
26
|
+
for (const method of ['Debug', 'Error', 'Info', 'Log', 'Trace', 'Warn']) {
|
|
27
|
+
consoleEE.on(`${method.toLowerCase()}-console-start`, function (args, target) {
|
|
28
|
+
// Parsing the args individually into a new array ensures that functions and Error objects are represented with
|
|
29
|
+
// useful string values. By default, functions stringify to null and Error objects stringify to empty objects.
|
|
30
|
+
// Note that stack traces printed by the console.trace method are not captured.
|
|
31
|
+
let parsedArgs = [];
|
|
32
|
+
for (const arg of args) {
|
|
33
|
+
if (typeof arg === 'function' || arg && arg.message && arg.stack // Duck typing for Error objects
|
|
34
|
+
) {
|
|
35
|
+
parsedArgs.push(arg.toString());
|
|
36
|
+
} else {
|
|
37
|
+
parsedArgs.push(arg);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const parsedArgsJSON = (0, _stringify.stringify)(parsedArgs);
|
|
41
|
+
(0, _handle.handle)(_constants.SUPPORTABILITY_METRIC_CHANNEL, [`Console/${method}/Seen`, parsedArgsJSON.length], undefined, _features.FEATURE_NAMES.metrics, consoleEE);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
19
45
|
}
|
|
20
46
|
exports.Instrument = Instrument;
|
|
@@ -94,7 +94,10 @@ function insertSupportMetrics(report) {
|
|
|
94
94
|
* @returns Refer to ServiceWorkerContainer.register()
|
|
95
95
|
*/
|
|
96
96
|
function extendServiceCreation(origFunc) {
|
|
97
|
-
return (
|
|
97
|
+
return function () {
|
|
98
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
99
|
+
args[_key] = arguments[_key];
|
|
100
|
+
}
|
|
98
101
|
reportWorkerCreationAttempt('Service', args[1]?.type);
|
|
99
102
|
return origFunc.apply(navigator.serviceWorker, args); // register() has to be rebound to the ServiceWorkerContainer object
|
|
100
103
|
};
|
|
@@ -22,7 +22,9 @@ var _globalScope = require("../../../common/util/global-scope");
|
|
|
22
22
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
23
23
|
static featureName = _constants.FEATURE_NAME;
|
|
24
24
|
constructor(agentIdentifier, aggregator) {
|
|
25
|
+
var _this;
|
|
25
26
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME);
|
|
27
|
+
_this = this;
|
|
26
28
|
this.eventsPerMinute = 240;
|
|
27
29
|
this.harvestTimeSeconds = (0, _config.getConfigurationValue)(this.agentIdentifier, 'page_action.harvestTimeSeconds') || (0, _config.getConfigurationValue)(this.agentIdentifier, 'ins.harvestTimeSeconds') || 30;
|
|
28
30
|
this.eventsPerHarvest = this.eventsPerMinute * this.harvestTimeSeconds / 60;
|
|
@@ -32,11 +34,17 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
32
34
|
this.att = (0, _config.getInfo)(this.agentIdentifier).jsAttributes; // per-agent, aggregators-shared info context
|
|
33
35
|
|
|
34
36
|
if (_globalScope.isBrowserScope && document.referrer) this.referrerUrl = (0, _cleanUrl.cleanURL)(document.referrer);
|
|
35
|
-
(0, _registerHandler.registerHandler)('api-addPageAction',
|
|
37
|
+
(0, _registerHandler.registerHandler)('api-addPageAction', function () {
|
|
38
|
+
return _this.addPageAction(...arguments);
|
|
39
|
+
}, this.featureName, this.ee);
|
|
36
40
|
var scheduler = new _harvestScheduler.HarvestScheduler('ins', {
|
|
37
|
-
onFinished: (
|
|
41
|
+
onFinished: function () {
|
|
42
|
+
return _this.onHarvestFinished(...arguments);
|
|
43
|
+
}
|
|
38
44
|
}, this);
|
|
39
|
-
scheduler.harvest.on('ins', (
|
|
45
|
+
scheduler.harvest.on('ins', function () {
|
|
46
|
+
return _this.onHarvestStarted(...arguments);
|
|
47
|
+
});
|
|
40
48
|
this.ee.on(`drain-${this.featureName}`, () => {
|
|
41
49
|
if (!this.blocked) scheduler.startTimer(this.harvestTimeSeconds, 0);
|
|
42
50
|
});
|
|
@@ -13,7 +13,8 @@ var _constants = require("../constants");
|
|
|
13
13
|
|
|
14
14
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
15
15
|
static featureName = _constants.FEATURE_NAME;
|
|
16
|
-
constructor(agentIdentifier, aggregator
|
|
16
|
+
constructor(agentIdentifier, aggregator) {
|
|
17
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
17
18
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|
|
18
19
|
this.importAggregator();
|
|
19
20
|
}
|
|
@@ -34,10 +34,11 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
34
34
|
|
|
35
35
|
/* Time To First Byte
|
|
36
36
|
This listener must record these values *before* PVE's aggregate sends RUM. */
|
|
37
|
-
(0, _webVitals.onTTFB)(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
(0, _webVitals.onTTFB)(_ref => {
|
|
38
|
+
let {
|
|
39
|
+
value,
|
|
40
|
+
entries
|
|
41
|
+
} = _ref;
|
|
41
42
|
if (this.alreadySent) return;
|
|
42
43
|
this.alreadySent = true;
|
|
43
44
|
agentRuntime[CONSTANTS.TTFB] = Math.round(value); // this is our "backend" duration; web-vitals will ensure it's lower bounded at 0
|
|
@@ -124,6 +125,9 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
124
125
|
var customJsAttributes = (0, _stringify.stringify)(info.jsAttributes);
|
|
125
126
|
chunksForQueryString.push((0, _encode.param)('ja', customJsAttributes === '{}' ? null : customJsAttributes));
|
|
126
127
|
var queryString = (0, _encode.fromArray)(chunksForQueryString, agentRuntime.maxBytes);
|
|
128
|
+
|
|
129
|
+
// Capture bytes sent to RUM call endpoint (currently `1`) as a supportability metric. See metrics aggregator (on unload).
|
|
130
|
+
agentRuntime.bytesSent[protocol] = (agentRuntime.bytesSent[protocol] || 0) + queryString?.length || 0;
|
|
127
131
|
const isValidJsonp = _submitData.submitData.jsonp(this.getScheme() + '://' + info.beacon + '/' + protocol + '/' + info.licenseKey + queryString, jsonp);
|
|
128
132
|
// Usually `drain` is invoked automatically after processing feature flags contained in the JSONP callback from
|
|
129
133
|
// ingest (see `activateFeatures`), so when JSONP cannot execute (as with module workers), we drain manually.
|
|
@@ -16,7 +16,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
18
18
|
static featureName = CONSTANTS.FEATURE_NAME;
|
|
19
|
-
constructor(agentIdentifier, aggregator
|
|
19
|
+
constructor(agentIdentifier, aggregator) {
|
|
20
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
20
21
|
super(agentIdentifier, aggregator, CONSTANTS.FEATURE_NAME, auto);
|
|
21
22
|
if ((typeof PerformanceNavigationTiming === 'undefined' || _iosVersion.isiOS) && typeof PerformanceTiming !== 'undefined') {
|
|
22
23
|
// For majority browser versions in which PNT exists, we can get load timings later from the nav entry (in the aggregate portion). At minimum, PT should exist for main window.
|
|
@@ -27,7 +27,9 @@ var _features = require("../../../loaders/features/features");
|
|
|
27
27
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
28
28
|
static featureName = _constants.FEATURE_NAME;
|
|
29
29
|
constructor(agentIdentifier, aggregator) {
|
|
30
|
+
var _this;
|
|
30
31
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME);
|
|
32
|
+
_this = this;
|
|
31
33
|
this.timings = [];
|
|
32
34
|
this.timingsSent = [];
|
|
33
35
|
this.curSessEndRecorded = false;
|
|
@@ -43,10 +45,11 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
43
45
|
this.alreadySent = new Set(); // since we don't support timings on BFCache restores, this tracks and helps cap metrics that web-vitals report more than once
|
|
44
46
|
|
|
45
47
|
/* PerformancePaintTiming API - BFC is not yet supported. */
|
|
46
|
-
(0, _firstPaint.onFirstPaint)(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
(0, _firstPaint.onFirstPaint)(_ref => {
|
|
49
|
+
let {
|
|
50
|
+
name,
|
|
51
|
+
value
|
|
52
|
+
} = _ref;
|
|
50
53
|
if (pageStartedHidden) return;
|
|
51
54
|
this.addTiming(name.toLowerCase(), Math.floor(value));
|
|
52
55
|
});
|
|
@@ -65,10 +68,11 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
65
68
|
}
|
|
66
69
|
} catch (e) {}
|
|
67
70
|
} else {
|
|
68
|
-
(0, _webVitals.onFCP)(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
(0, _webVitals.onFCP)(_ref2 => {
|
|
72
|
+
let {
|
|
73
|
+
name,
|
|
74
|
+
value
|
|
75
|
+
} = _ref2;
|
|
72
76
|
if (pageStartedHidden || this.alreadySent.has(name)) return;
|
|
73
77
|
this.alreadySent.add(name);
|
|
74
78
|
this.addTiming(name.toLowerCase(), value);
|
|
@@ -76,11 +80,12 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
/* First Input Delay (+"First Interaction") - As of WV v3, it still imperfectly tries to detect document vis state asap and isn't supposed to report if page starts hidden. */
|
|
79
|
-
(0, _webVitals.onFID)(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
(0, _webVitals.onFID)(_ref3 => {
|
|
84
|
+
let {
|
|
85
|
+
name,
|
|
86
|
+
value,
|
|
87
|
+
entries
|
|
88
|
+
} = _ref3;
|
|
84
89
|
if (pageStartedHidden || this.alreadySent.has(name)) return;
|
|
85
90
|
this.alreadySent.add(name);
|
|
86
91
|
|
|
@@ -95,11 +100,12 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
95
100
|
});
|
|
96
101
|
|
|
97
102
|
/* Largest Contentful Paint - As of WV v3, it still imperfectly tries to detect document vis state asap and isn't supposed to report if page starts hidden. */
|
|
98
|
-
(0, _webVitals.onLCP)(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
(0, _webVitals.onLCP)(_ref4 => {
|
|
104
|
+
let {
|
|
105
|
+
name,
|
|
106
|
+
value,
|
|
107
|
+
entries
|
|
108
|
+
} = _ref4;
|
|
103
109
|
if (pageStartedHidden || this.alreadySent.has(name)) return;
|
|
104
110
|
this.alreadySent.add(name);
|
|
105
111
|
|
|
@@ -120,34 +126,47 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
120
126
|
});
|
|
121
127
|
|
|
122
128
|
/* Cumulative Layout Shift - We don't have to limit this callback since cls is stored as a state and only sent as attribute on other timings. */
|
|
123
|
-
(0, _webVitals.onCLS)(
|
|
124
|
-
|
|
125
|
-
|
|
129
|
+
(0, _webVitals.onCLS)(_ref5 => {
|
|
130
|
+
let {
|
|
131
|
+
value
|
|
132
|
+
} = _ref5;
|
|
133
|
+
return this.cls = value;
|
|
134
|
+
});
|
|
126
135
|
|
|
127
136
|
/* Interaction-to-Next-Paint */
|
|
128
|
-
(0, _webVitals.onINP)(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
(0, _webVitals.onINP)(_ref6 => {
|
|
138
|
+
let {
|
|
139
|
+
name,
|
|
140
|
+
value,
|
|
141
|
+
id
|
|
142
|
+
} = _ref6;
|
|
143
|
+
return this.addTiming(name.toLowerCase(), value, {
|
|
144
|
+
metricId: id
|
|
145
|
+
});
|
|
146
|
+
});
|
|
135
147
|
|
|
136
148
|
/* PerformanceLongTaskTiming API */
|
|
137
149
|
if ((0, _config.getConfigurationValue)(this.agentIdentifier, 'page_view_timing.long_task') === true) {
|
|
138
|
-
(0, _longTasks.onLongTask)(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
150
|
+
(0, _longTasks.onLongTask)(_ref7 => {
|
|
151
|
+
let {
|
|
152
|
+
name,
|
|
153
|
+
value,
|
|
154
|
+
info
|
|
155
|
+
} = _ref7;
|
|
156
|
+
return this.addTiming(name.toLowerCase(), value, info);
|
|
157
|
+
}); // lt context is passed as 'info'=attrs in the timing node
|
|
143
158
|
}
|
|
144
159
|
/* ------------------------------------End of ex-loader section */
|
|
145
160
|
|
|
146
161
|
/* It's important that CWV api, like "onLCP", is called before this scheduler is initialized. The reason is because they listen to the same
|
|
147
162
|
on vis change or pagehide events, and we'd want ex. onLCP to record the timing (win the race) before we try to send "final harvest". */
|
|
148
163
|
this.scheduler = new _harvestScheduler.HarvestScheduler('events', {
|
|
149
|
-
onFinished: (
|
|
150
|
-
|
|
164
|
+
onFinished: function () {
|
|
165
|
+
return _this.onHarvestFinished(...arguments);
|
|
166
|
+
},
|
|
167
|
+
getPayload: function () {
|
|
168
|
+
return _this.prepareHarvest(...arguments);
|
|
169
|
+
}
|
|
151
170
|
}, this);
|
|
152
171
|
(0, _registerHandler.registerHandler)('timing', (name, value, attrs) => this.addTiming(name, value, attrs), this.featureName, this.ee); // notice CLS is added to all timings via 4th param
|
|
153
172
|
(0, _registerHandler.registerHandler)('docHidden', msTimestamp => this.endCurrentSession(msTimestamp), this.featureName, this.ee);
|
|
@@ -19,7 +19,8 @@ var _globalScope = require("../../../common/util/global-scope");
|
|
|
19
19
|
|
|
20
20
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
21
21
|
static featureName = _constants.FEATURE_NAME;
|
|
22
|
-
constructor(agentIdentifier, aggregator
|
|
22
|
+
constructor(agentIdentifier, aggregator) {
|
|
23
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
23
24
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|
|
24
25
|
if (!_globalScope.isBrowserScope) return; // CWV is irrelevant outside web context
|
|
25
26
|
|
|
@@ -7,7 +7,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
9
|
var _mapOwn = require("../../../common/util/map-own");
|
|
10
|
-
var _reduce = require("../../../common/util/reduce");
|
|
11
10
|
var _stringify = require("../../../common/util/stringify");
|
|
12
11
|
var _parseUrl = require("../../../common/url/parse-url");
|
|
13
12
|
var _supportsPerformanceObserver = require("../../../common/window/supports-performance-observer");
|
|
@@ -27,8 +26,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
26
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
28
27
|
static featureName = _constants.FEATURE_NAME;
|
|
29
28
|
constructor(agentIdentifier, aggregator) {
|
|
29
|
+
var _this;
|
|
30
30
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME);
|
|
31
|
-
|
|
31
|
+
_this = this;
|
|
32
32
|
// Very unlikely, but in case the existing XMLHttpRequest.prototype object on the page couldn't be wrapped.
|
|
33
33
|
if (!(0, _config.getRuntime)(agentIdentifier).xhrWrappable) return;
|
|
34
34
|
const handlerCache = new _handlerCache.HandlerCache();
|
|
@@ -130,14 +130,54 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
130
130
|
}, this.featureName, this.ee);
|
|
131
131
|
|
|
132
132
|
// register the handlers immediately... but let the handlerCache decide if the data should actually get stored...
|
|
133
|
-
(0, _registerHandler.registerHandler)('bst',
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
(0, _registerHandler.registerHandler)('
|
|
140
|
-
|
|
133
|
+
(0, _registerHandler.registerHandler)('bst', function () {
|
|
134
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
135
|
+
args[_key] = arguments[_key];
|
|
136
|
+
}
|
|
137
|
+
return handlerCache.settle(() => _this.storeEvent(...args));
|
|
138
|
+
}, this.featureName, this.ee);
|
|
139
|
+
(0, _registerHandler.registerHandler)('bstTimer', function () {
|
|
140
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
141
|
+
args[_key2] = arguments[_key2];
|
|
142
|
+
}
|
|
143
|
+
return handlerCache.settle(() => _this.storeTimer(...args));
|
|
144
|
+
}, this.featureName, this.ee);
|
|
145
|
+
(0, _registerHandler.registerHandler)('bstResource', function () {
|
|
146
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
147
|
+
args[_key3] = arguments[_key3];
|
|
148
|
+
}
|
|
149
|
+
return handlerCache.settle(() => _this.storeResources(...args));
|
|
150
|
+
}, this.featureName, this.ee);
|
|
151
|
+
(0, _registerHandler.registerHandler)('bstHist', function () {
|
|
152
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
153
|
+
args[_key4] = arguments[_key4];
|
|
154
|
+
}
|
|
155
|
+
return handlerCache.settle(() => _this.storeHist(...args));
|
|
156
|
+
}, this.featureName, this.ee);
|
|
157
|
+
(0, _registerHandler.registerHandler)('bstXhrAgg', function () {
|
|
158
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
159
|
+
args[_key5] = arguments[_key5];
|
|
160
|
+
}
|
|
161
|
+
return handlerCache.settle(() => _this.storeXhrAgg(...args));
|
|
162
|
+
}, this.featureName, this.ee);
|
|
163
|
+
(0, _registerHandler.registerHandler)('bstApi', function () {
|
|
164
|
+
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
165
|
+
args[_key6] = arguments[_key6];
|
|
166
|
+
}
|
|
167
|
+
return handlerCache.settle(() => _this.storeSTN(...args));
|
|
168
|
+
}, this.featureName, this.ee);
|
|
169
|
+
(0, _registerHandler.registerHandler)('errorAgg', function () {
|
|
170
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
171
|
+
args[_key7] = arguments[_key7];
|
|
172
|
+
}
|
|
173
|
+
return handlerCache.settle(() => _this.storeErrorAgg(...args));
|
|
174
|
+
}, this.featureName, this.ee);
|
|
175
|
+
(0, _registerHandler.registerHandler)('pvtAdded', function () {
|
|
176
|
+
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
|
177
|
+
args[_key8] = arguments[_key8];
|
|
178
|
+
}
|
|
179
|
+
return handlerCache.settle(() => _this.processPVT(...args));
|
|
180
|
+
}, this.featureName, this.ee);
|
|
141
181
|
(0, _drain.drain)(this.agentIdentifier, this.featureName);
|
|
142
182
|
}
|
|
143
183
|
processPVT(name, value, attrs) {
|
|
@@ -296,10 +336,10 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
296
336
|
if (!(0, _supportsPerformanceObserver.supportsPerformanceObserver)()) {
|
|
297
337
|
this.storeResources(window.performance.getEntriesByType('resource'));
|
|
298
338
|
}
|
|
299
|
-
var stns = (0,
|
|
339
|
+
var stns = (0, _mapOwn.mapOwn)(this.trace, (name, nodes) => {
|
|
300
340
|
if (!(name in this.toAggregate)) return nodes;
|
|
301
|
-
return (0,
|
|
302
|
-
})
|
|
341
|
+
return (0, _mapOwn.mapOwn)(nodes.sort(this.byStart).reduce(this.smearEvtsByOrigin(name), {}), this.val).reduce(this.flatten, []);
|
|
342
|
+
}).reduce(this.flatten, []);
|
|
303
343
|
if (stns.length === 0) return {};
|
|
304
344
|
if (retry) {
|
|
305
345
|
this.sentTrace = this.trace;
|
|
@@ -37,7 +37,8 @@ const {
|
|
|
37
37
|
const CRT = 'clearResourceTimings';
|
|
38
38
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
39
39
|
static featureName = FEATURE_NAME;
|
|
40
|
-
constructor(agentIdentifier, aggregator
|
|
40
|
+
constructor(agentIdentifier, aggregator) {
|
|
41
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
41
42
|
super(agentIdentifier, aggregator, FEATURE_NAME, auto);
|
|
42
43
|
if (!_globalScope.isBrowserScope) return; // session traces not supported outside web env
|
|
43
44
|
|
|
@@ -32,7 +32,8 @@ const {
|
|
|
32
32
|
} = CONSTANTS;
|
|
33
33
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
34
34
|
static featureName = FEATURE_NAME;
|
|
35
|
-
constructor(agentIdentifier, aggregator
|
|
35
|
+
constructor(agentIdentifier, aggregator) {
|
|
36
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
36
37
|
super(agentIdentifier, aggregator, FEATURE_NAME, auto);
|
|
37
38
|
if (!_globalScope.isBrowserScope) return; // SPA not supported outside web env
|
|
38
39
|
|
|
@@ -25,7 +25,8 @@ class InstrumentBase extends _featureBase.FeatureBase {
|
|
|
25
25
|
* of its pooled instrumentation data handled by the agent's centralized drain functionality, rather than draining
|
|
26
26
|
* immediately. Primarily useful for fine-grained control in tests.
|
|
27
27
|
*/
|
|
28
|
-
constructor(agentIdentifier, aggregator, featureName
|
|
28
|
+
constructor(agentIdentifier, aggregator, featureName) {
|
|
29
|
+
let auto = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
29
30
|
super(agentIdentifier, aggregator, featureName);
|
|
30
31
|
this.hasAggregator = false;
|
|
31
32
|
this.auto = auto;
|