@sentry/browser 10.11.0 → 10.12.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 (32) hide show
  1. package/build/npm/cjs/index.js +1 -0
  2. package/build/npm/cjs/index.js.map +1 -1
  3. package/build/npm/cjs/tracing/browserTracingIntegration.js +20 -2
  4. package/build/npm/cjs/tracing/browserTracingIntegration.js.map +1 -1
  5. package/build/npm/cjs/tracing/request.js +1 -3
  6. package/build/npm/cjs/tracing/request.js.map +1 -1
  7. package/build/npm/cjs/transports/fetch.js +13 -19
  8. package/build/npm/cjs/transports/fetch.js.map +1 -1
  9. package/build/npm/esm/index.js +1 -1
  10. package/build/npm/esm/package.json +1 -1
  11. package/build/npm/esm/tracing/browserTracingIntegration.js +21 -3
  12. package/build/npm/esm/tracing/browserTracingIntegration.js.map +1 -1
  13. package/build/npm/esm/tracing/request.js +2 -4
  14. package/build/npm/esm/tracing/request.js.map +1 -1
  15. package/build/npm/esm/transports/fetch.js +14 -20
  16. package/build/npm/esm/transports/fetch.js.map +1 -1
  17. package/build/npm/types/index.d.ts +1 -1
  18. package/build/npm/types/index.d.ts.map +1 -1
  19. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  20. package/build/npm/types/tracing/request.d.ts.map +1 -1
  21. package/build/npm/types/transports/fetch.d.ts +1 -1
  22. package/build/npm/types/transports/fetch.d.ts.map +1 -1
  23. package/build/npm/types-ts3.8/index.d.ts +1 -1
  24. package/build/npm/types-ts3.8/transports/fetch.d.ts +1 -1
  25. package/package.json +7 -7
  26. package/build/npm/cjs/tracing/resource-timing.js +0 -45
  27. package/build/npm/cjs/tracing/resource-timing.js.map +0 -1
  28. package/build/npm/esm/tracing/resource-timing.js +0 -43
  29. package/build/npm/esm/tracing/resource-timing.js.map +0 -1
  30. package/build/npm/types/tracing/resource-timing.d.ts +0 -9
  31. package/build/npm/types/tracing/resource-timing.d.ts.map +0 -1
  32. package/build/npm/types-ts3.8/tracing/resource-timing.d.ts +0 -9
@@ -1,43 +0,0 @@
1
- import { browserPerformanceTimeOrigin } from '@sentry/core';
2
- import { extractNetworkProtocol } from '@sentry-internal/browser-utils';
3
-
4
- function getAbsoluteTime(time = 0) {
5
- return ((browserPerformanceTimeOrigin() || performance.timeOrigin) + time) / 1000;
6
- }
7
-
8
- /**
9
- * Converts a PerformanceResourceTiming entry to span data for the resource span.
10
- *
11
- * @param resourceTiming
12
- * @returns An array where the first element is the attribute name and the second element is the attribute value.
13
- */
14
- function resourceTimingToSpanAttributes(
15
- resourceTiming,
16
- ) {
17
- const timingSpanData = [];
18
- // Checking for only `undefined` and `null` is intentional because it's
19
- // valid for `nextHopProtocol` to be an empty string.
20
- if (resourceTiming.nextHopProtocol != undefined) {
21
- const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);
22
- timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);
23
- }
24
- if (!browserPerformanceTimeOrigin()) {
25
- return timingSpanData;
26
- }
27
- return [
28
- ...timingSpanData,
29
- ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],
30
- ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],
31
- ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],
32
- ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],
33
- ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],
34
- ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],
35
- ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],
36
- ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],
37
- ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],
38
- ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],
39
- ];
40
- }
41
-
42
- export { resourceTimingToSpanAttributes };
43
- //# sourceMappingURL=resource-timing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-timing.js","sources":["../../../../src/tracing/resource-timing.ts"],"sourcesContent":["import type { Span } from '@sentry/core';\nimport { browserPerformanceTimeOrigin } from '@sentry/core';\nimport { extractNetworkProtocol } from '@sentry-internal/browser-utils';\n\nfunction getAbsoluteTime(time: number = 0): number {\n return ((browserPerformanceTimeOrigin() || performance.timeOrigin) + time) / 1000;\n}\n\n/**\n * Converts a PerformanceResourceTiming entry to span data for the resource span.\n *\n * @param resourceTiming\n * @returns An array where the first element is the attribute name and the second element is the attribute value.\n */\nexport function resourceTimingToSpanAttributes(\n resourceTiming: PerformanceResourceTiming,\n): Array<Parameters<Span['setAttribute']>> {\n const timingSpanData: Array<Parameters<Span['setAttribute']>> = [];\n // Checking for only `undefined` and `null` is intentional because it's\n // valid for `nextHopProtocol` to be an empty string.\n if (resourceTiming.nextHopProtocol != undefined) {\n const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);\n timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);\n }\n if (!browserPerformanceTimeOrigin()) {\n return timingSpanData;\n }\n return [\n ...timingSpanData,\n ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],\n ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],\n ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],\n ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],\n ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],\n ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],\n ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],\n ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],\n ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],\n ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],\n ];\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,eAAe,CAAC,IAAI,GAAW,CAAC,EAAU;AACnD,EAAE,O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AAE,eAAe,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AAClF,IAAI,CAAC,2BAA2B,EAAE,eAAe,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAC9E,GAAG;AACH;;;;"}
@@ -1,9 +0,0 @@
1
- import type { Span } from '@sentry/core';
2
- /**
3
- * Converts a PerformanceResourceTiming entry to span data for the resource span.
4
- *
5
- * @param resourceTiming
6
- * @returns An array where the first element is the attribute name and the second element is the attribute value.
7
- */
8
- export declare function resourceTimingToSpanAttributes(resourceTiming: PerformanceResourceTiming): Array<Parameters<Span['setAttribute']>>;
9
- //# sourceMappingURL=resource-timing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-timing.d.ts","sourceRoot":"","sources":["../../../../src/tracing/resource-timing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAQzC;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,yBAAyB,GACxC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAwBzC"}
@@ -1,9 +0,0 @@
1
- import { Span } from '@sentry/core';
2
- /**
3
- * Converts a PerformanceResourceTiming entry to span data for the resource span.
4
- *
5
- * @param resourceTiming
6
- * @returns An array where the first element is the attribute name and the second element is the attribute value.
7
- */
8
- export declare function resourceTimingToSpanAttributes(resourceTiming: PerformanceResourceTiming): Array<Parameters<Span['setAttribute']>>;
9
- //# sourceMappingURL=resource-timing.d.ts.map