Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Aug 23, 2021
1 parent 5426a30 commit 0c424d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/tracing/src/browser/browsertracing.ts
Expand Up @@ -7,7 +7,7 @@ import { DEFAULT_IDLE_TIMEOUT, IdleTransaction } from '../idletransaction';
import { SpanStatus } from '../spanstatus';
import { extractTraceparentData, secToMs } from '../utils';
import { registerBackgroundTabDetection } from './backgroundtab';
import { MetricsInstrumentation, MetricsInstrumentationOptions } from './metrics';
import { DEFAULT_METRICS_INSTR_OPTIONS, MetricsInstrumentation, MetricsInstrumentationOptions } from './metrics';
import {
defaultRequestInstrumentationOptions,
instrumentOutgoingRequests,
Expand Down Expand Up @@ -149,7 +149,7 @@ export class BrowserTracing implements Integration {
tracingOrigins,
};

this._metrics = new MetricsInstrumentation(this.options._metricOptions);
this._metrics = new MetricsInstrumentation({ ...this.options._metricOptions, ...DEFAULT_METRICS_INSTR_OPTIONS });
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/tracing/src/browser/metrics.ts
Expand Up @@ -21,7 +21,7 @@ export interface MetricsInstrumentationOptions {
_reportAllChanges: boolean;
}

const DEFAULT_METRICS_INSTR_OPTIONS: MetricsInstrumentationOptions = {
export const DEFAULT_METRICS_INSTR_OPTIONS: MetricsInstrumentationOptions = {
_reportAllChanges: false,
};

Expand All @@ -33,7 +33,7 @@ export class MetricsInstrumentation {
private _lcpEntry: LargestContentfulPaint | undefined;
private _clsEntry: LayoutShift | undefined;

public constructor(_options: MetricsInstrumentationOptions = DEFAULT_METRICS_INSTR_OPTIONS) {
public constructor(_options: MetricsInstrumentationOptions) {
if (!isNodeEnv() && global?.performance) {
if (global.performance.mark) {
global.performance.mark('sentry-tracing-init');
Expand Down

0 comments on commit 0c424d6

Please sign in to comment.