@@ -152,19 +152,39 @@ export interface BrowserTracingOptions {
152152 ignoreResourceSpans : Array < 'resouce.script' | 'resource.css' | 'resource.img' | 'resource.other' | string > ;
153153
154154 /**
155- * Spans created from
156- * [`performance.mark(...)`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)
157- * and
158- * [`performance.measure(...)`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)
159- * calls will not be emitted if their names match strings in this array.
155+ * Spans created from the following browser Performance APIs,
156+ *
157+ * - [`performance.mark(...)`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)
158+ * - [`performance.measure(...)`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)
159+ *
160+ * will not be emitted if their names match strings in this array.
160161 *
161162 * This is useful, if you come across `mark` or `measure` spans in your Sentry traces
162163 * that you want to ignore. For example, sometimes, browser extensions or libraries
163164 * emit these entries on their own, which might not be relevant to your application.
164165 *
166+ * * @example
167+ * ```ts
168+ * Sentry.init({
169+ * integrations: [
170+ * Sentry.browserTracingIntegration({
171+ * ignorePerformanceApiSpans: ['myMeasurement', /myMark/],
172+ * }),
173+ * ],
174+ * });
175+ *
176+ * // no spans will be created for these:
177+ * performance.mark('myMark');
178+ * performance.measure('myMeasurement');
179+ *
180+ * // spans will be created for these:
181+ * performance.mark('authenticated');
182+ * performance.measure('input-duration', ...);
183+ * ```
184+ *
165185 * Default: [] - By default, all `mark` and `measure` entries are sent as spans.
166186 */
167- ignoreMeasureSpans : Array < string | RegExp > ;
187+ ignorePerformanceApiSpans : Array < string | RegExp > ;
168188
169189 /**
170190 * Link the currently started trace to a previous trace (e.g. a prior pageload, navigation or
@@ -249,7 +269,7 @@ const DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {
249269 enableLongAnimationFrame : true ,
250270 enableInp : true ,
251271 ignoreResourceSpans : [ ] ,
252- ignoreMeasureSpans : [ ] ,
272+ ignorePerformanceApiSpans : [ ] ,
253273 linkPreviousTrace : 'in-memory' ,
254274 consistentTraceSampling : false ,
255275 _experiments : { } ,
@@ -293,7 +313,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
293313 shouldCreateSpanForRequest,
294314 enableHTTPTimings,
295315 ignoreResourceSpans,
296- ignoreMeasureSpans ,
316+ ignorePerformanceApiSpans ,
297317 instrumentPageLoad,
298318 instrumentNavigation,
299319 linkPreviousTrace,
@@ -339,7 +359,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
339359 addPerformanceEntries ( span , {
340360 recordClsOnPageloadSpan : ! enableStandaloneClsSpans ,
341361 ignoreResourceSpans,
342- ignoreMeasureSpans ,
362+ ignorePerformanceApiSpans ,
343363 } ) ;
344364 setActiveIdleSpan ( client , undefined ) ;
345365
0 commit comments