@sentry-internal/browser-utils
Advanced tools
Comparing version
@@ -268,3 +268,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
case 'measure': { | ||
_addMeasureSpans(span, entry, startTime, duration, timeOrigin); | ||
_addMeasureSpans(span, entry, startTime, duration, timeOrigin, options.ignorePerformanceApiSpans); | ||
@@ -363,3 +363,11 @@ // capture web vitals | ||
timeOrigin, | ||
ignorePerformanceApiSpans, | ||
) { | ||
if ( | ||
['mark', 'measure'].includes(entry.entryType) && | ||
core.stringMatchesSomePattern(entry.name, ignorePerformanceApiSpans) | ||
) { | ||
return; | ||
} | ||
const navEntry = getNavigationEntry.getNavigationEntry(false); | ||
@@ -366,0 +374,0 @@ const requestTime = utils.msToSec(navEntry ? navEntry.requestStart : 0); |
@@ -1,2 +0,2 @@ | ||
import { browserPerformanceTimeOrigin, spanToJSON, setMeasurement, getActiveSpan, parseUrl, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, htmlTreeAsString, getComponentName } from '@sentry/core'; | ||
import { browserPerformanceTimeOrigin, spanToJSON, setMeasurement, getActiveSpan, parseUrl, stringMatchesSomePattern, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, htmlTreeAsString, getComponentName } from '@sentry/core'; | ||
import { WINDOW } from '../types.js'; | ||
@@ -266,3 +266,3 @@ import { trackClsAsStandaloneSpan } from './cls.js'; | ||
case 'measure': { | ||
_addMeasureSpans(span, entry, startTime, duration, timeOrigin); | ||
_addMeasureSpans(span, entry, startTime, duration, timeOrigin, options.ignorePerformanceApiSpans); | ||
@@ -361,3 +361,11 @@ // capture web vitals | ||
timeOrigin, | ||
ignorePerformanceApiSpans, | ||
) { | ||
if ( | ||
['mark', 'measure'].includes(entry.entryType) && | ||
stringMatchesSomePattern(entry.name, ignorePerformanceApiSpans) | ||
) { | ||
return; | ||
} | ||
const navEntry = getNavigationEntry(false); | ||
@@ -364,0 +372,0 @@ const requestTime = msToSec(navEntry ? navEntry.requestStart : 0); |
@@ -1,1 +0,1 @@ | ||
{"type":"module","version":"9.24.0","sideEffects":false} | ||
{"type":"module","version":"9.25.0","sideEffects":false} |
@@ -37,2 +37,10 @@ import { Span } from '@sentry/core'; | ||
ignoreResourceSpans: Array<'resouce.script' | 'resource.css' | 'resource.img' | 'resource.other' | string>; | ||
/** | ||
* Performance spans created from browser Performance APIs, | ||
* `performance.mark(...)` nand `performance.measure(...)` | ||
* with `name`s matching strings in the array will not be emitted. | ||
* | ||
* Default: [] | ||
*/ | ||
ignorePerformanceApiSpans: Array<string | RegExp>; | ||
} | ||
@@ -45,3 +53,3 @@ /** Add performance related spans to a transaction */ | ||
*/ | ||
export declare function _addMeasureSpans(span: Span, entry: PerformanceEntry, startTime: number, duration: number, timeOrigin: number): void; | ||
export declare function _addMeasureSpans(span: Span, entry: PerformanceEntry, startTime: number, duration: number, timeOrigin: number, ignorePerformanceApiSpans: AddPerformanceEntriesOptions['ignorePerformanceApiSpans']): void; | ||
/** | ||
@@ -48,0 +56,0 @@ * Instrument navigation entries |
@@ -37,2 +37,10 @@ import type { Span } from '@sentry/core'; | ||
ignoreResourceSpans: Array<'resouce.script' | 'resource.css' | 'resource.img' | 'resource.other' | string>; | ||
/** | ||
* Performance spans created from browser Performance APIs, | ||
* `performance.mark(...)` nand `performance.measure(...)` | ||
* with `name`s matching strings in the array will not be emitted. | ||
* | ||
* Default: [] | ||
*/ | ||
ignorePerformanceApiSpans: Array<string | RegExp>; | ||
} | ||
@@ -45,3 +53,3 @@ /** Add performance related spans to a transaction */ | ||
*/ | ||
export declare function _addMeasureSpans(span: Span, entry: PerformanceEntry, startTime: number, duration: number, timeOrigin: number): void; | ||
export declare function _addMeasureSpans(span: Span, entry: PerformanceEntry, startTime: number, duration: number, timeOrigin: number, ignorePerformanceApiSpans: AddPerformanceEntriesOptions['ignorePerformanceApiSpans']): void; | ||
/** | ||
@@ -48,0 +56,0 @@ * Instrument navigation entries |
{ | ||
"name": "@sentry-internal/browser-utils", | ||
"version": "9.24.0", | ||
"version": "9.25.0", | ||
"description": "Browser Utilities for all Sentry JavaScript SDKs", | ||
@@ -42,3 +42,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/core": "9.24.0" | ||
"@sentry/core": "9.25.0" | ||
}, | ||
@@ -45,0 +45,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
753803
0.39%8206
0.37%+ Added
- Removed
Updated