@spotlightjs/overlay 2.11.1 → 2.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.
- package/dist/index.d.ts +2 -2
- package/dist/integrations/sentry/data/profiles.d.ts +10 -0
- package/dist/integrations/sentry/data/sentryDataCache.d.ts +10 -7
- package/dist/integrations/sentry/data/useSentryEnvelopes.d.ts +2 -2
- package/dist/integrations/sentry/data/useSentrySpans.d.ts +9 -1
- package/dist/integrations/sentry/sentry-integration.d.ts +2 -2
- package/dist/integrations/sentry/types.d.ts +57 -3
- package/dist/integrations/sentry/utils/duration.d.ts +11 -16
- package/dist/integrations/sentry/utils/traces.d.ts +6 -1
- package/dist/sentry-spotlight.iife.js +106 -106
- package/dist/sentry-spotlight.iife.js.map +1 -1
- package/dist/sentry-spotlight.js +8528 -8363
- package/dist/sentry-spotlight.js.map +1 -1
- package/dist/sentry-spotlight.umd.cjs +106 -106
- package/dist/sentry-spotlight.umd.cjs.map +1 -1
- package/dist/ui/SidePanel/SidePanel.d.ts +1 -0
- package/package.json +4 -4
- package/dist/integrations/sentry/data/useSentryTraces.d.ts +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONTEXT_LINES_ENDPOINT } from '@spotlightjs/sidecar/constants';
|
|
2
|
-
import { DEFAULT_ANCHOR, DEFAULT_EXPERIMENTS, DEFAULT_SIDECAR_STREAM_URL } from './constants';
|
|
2
|
+
import { DEFAULT_ANCHOR, DEFAULT_EXPERIMENTS, DEFAULT_SIDECAR_STREAM_URL, SPOTLIGHT_OPEN_CLASS_NAME } from './constants';
|
|
3
3
|
import { off, on, trigger } from './lib/eventTarget';
|
|
4
4
|
import { React, ReactDOM } from './react-instance';
|
|
5
5
|
import { SpotlightOverlayOptions } from './types';
|
|
@@ -9,7 +9,7 @@ export { default as hydrationError } from './integrations/hydration-error/index'
|
|
|
9
9
|
export { default as sentry } from './integrations/sentry/index';
|
|
10
10
|
export { default as viteInspect } from './integrations/vite-inspect/index';
|
|
11
11
|
export type { SpotlightOverlayOptions, WindowWithSpotlight } from './types';
|
|
12
|
-
export { CONTEXT_LINES_ENDPOINT, DEFAULT_ANCHOR, DEFAULT_EXPERIMENTS, DEFAULT_SIDECAR_STREAM_URL as DEFAULT_SIDECAR_URL, off, on, React, ReactDOM, trigger, };
|
|
12
|
+
export { SPOTLIGHT_OPEN_CLASS_NAME, CONTEXT_LINES_ENDPOINT, DEFAULT_ANCHOR, DEFAULT_EXPERIMENTS, DEFAULT_SIDECAR_STREAM_URL as DEFAULT_SIDECAR_URL, off, on, React, ReactDOM, trigger, };
|
|
13
13
|
/**
|
|
14
14
|
* Open the Spotlight debugger Window
|
|
15
15
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Span, Trace } from '../types';
|
|
2
|
+
import { SentryProfileWithTraceMeta } from './sentryDataCache';
|
|
3
|
+
|
|
4
|
+
export declare function getSpansFromProfile(trace: Trace, profile: SentryProfileWithTraceMeta, parent_span_id: string | undefined, startTs: number, endTs: number, threadIds: Set<string>): Span[];
|
|
5
|
+
/**
|
|
6
|
+
* Modifies the spanTree in place recursively by adding spans from the
|
|
7
|
+
* profile data where there are gaps in the trace data.
|
|
8
|
+
* @param spanTree Span[] The tree of spans to graft profile spans into
|
|
9
|
+
*/
|
|
10
|
+
export declare function graftProfileSpans(trace: Trace, spanTree?: Span[], parent?: Span | Trace, profile?: SentryProfileWithTraceMeta): void;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { Envelope } from '@sentry/
|
|
1
|
+
import { Envelope } from '@sentry/core';
|
|
2
2
|
import { RawEventContext } from '../../integration';
|
|
3
|
-
import { Sdk, SentryErrorEvent, SentryEvent,
|
|
3
|
+
import { Sdk, SentryErrorEvent, SentryEvent, SentryProcessedProfile, Trace } from '../types';
|
|
4
4
|
|
|
5
5
|
type OnlineSubscription = ['online', (status: boolean) => void];
|
|
6
6
|
type EventSubscription = ['event', (event: SentryEvent) => void];
|
|
7
7
|
type TraceSubscription = ['trace', (trace: Trace) => void];
|
|
8
8
|
type Subscription = OnlineSubscription | EventSubscription | TraceSubscription;
|
|
9
|
+
export type SentryProfileWithTraceMeta = SentryProcessedProfile & {
|
|
10
|
+
timestamp: number;
|
|
11
|
+
active_thread_id: string;
|
|
12
|
+
};
|
|
9
13
|
declare class SentryDataCache {
|
|
10
14
|
protected events: SentryEvent[];
|
|
11
15
|
protected eventIds: Set<string>;
|
|
12
16
|
protected sdks: Sdk[];
|
|
13
17
|
protected traces: Trace[];
|
|
14
|
-
protected tracesById:
|
|
15
|
-
|
|
16
|
-
};
|
|
18
|
+
protected tracesById: Map<string, Trace>;
|
|
19
|
+
protected profilesByTraceId: Map<string, SentryProfileWithTraceMeta>;
|
|
17
20
|
protected localTraceIds: Set<string>;
|
|
18
21
|
protected envelopes: {
|
|
19
22
|
envelope: Envelope;
|
|
@@ -41,9 +44,9 @@ declare class SentryDataCache {
|
|
|
41
44
|
rawEnvelope: RawEventContext;
|
|
42
45
|
}[];
|
|
43
46
|
getEventById(id: string): SentryEvent | undefined;
|
|
44
|
-
getTraceById(id: string): Trace;
|
|
47
|
+
getTraceById(id: string): Trace | undefined;
|
|
48
|
+
getProfileByTraceId(id: string): SentryProfileWithTraceMeta | undefined;
|
|
45
49
|
getEventsByTrace(traceId: string, spanId?: string | null): SentryEvent[];
|
|
46
|
-
getSpanById(traceId: string, spanId: string): Span | undefined;
|
|
47
50
|
resetData(): void;
|
|
48
51
|
subscribe(...args: Subscription): () => void;
|
|
49
52
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const useSentryEnvelopes: () => {
|
|
2
2
|
allEnvelopes: {
|
|
3
|
-
envelope: import('@sentry/
|
|
3
|
+
envelope: import('@sentry/core').Envelope;
|
|
4
4
|
rawEnvelope: import('../../integration').RawEventContext;
|
|
5
5
|
}[];
|
|
6
6
|
localEnvelopes: {
|
|
7
|
-
envelope: import('@sentry/
|
|
7
|
+
envelope: import('@sentry/core').Envelope;
|
|
8
8
|
rawEnvelope: import('../../integration').RawEventContext;
|
|
9
9
|
}[];
|
|
10
10
|
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { Span } from '../types';
|
|
1
|
+
import { Span, Trace } from '../types';
|
|
2
2
|
|
|
3
|
+
export declare function useSentryTraces(): {
|
|
4
|
+
allTraces: Trace[];
|
|
5
|
+
localTraces: Trace[];
|
|
6
|
+
};
|
|
3
7
|
export declare const useSentrySpans: () => {
|
|
4
8
|
allSpans: Span[];
|
|
5
9
|
localSpans: Span[];
|
|
6
10
|
};
|
|
11
|
+
export declare const useSentrySpanCounts: () => {
|
|
12
|
+
allSpans: number;
|
|
13
|
+
localSpans: number;
|
|
14
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Event } from '@sentry/
|
|
1
|
+
import { Client, Event } from '@sentry/core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A Sentry integration for Spotlight integration that the Overlay will inject automatically.
|
|
@@ -14,6 +14,6 @@ export declare const spotlightIntegration: () => {
|
|
|
14
14
|
name: string;
|
|
15
15
|
setupOnce: () => void;
|
|
16
16
|
setup: () => void;
|
|
17
|
-
processEvent: (event: Event) =>
|
|
17
|
+
processEvent: (event: Event) => Event | null;
|
|
18
18
|
afterAllSetup: (client: Client) => () => void;
|
|
19
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Measurements } from '@sentry/
|
|
1
|
+
import { Measurements } from '@sentry/core';
|
|
2
2
|
|
|
3
3
|
export type FrameVars = {
|
|
4
4
|
[key: string]: string;
|
|
@@ -14,6 +14,7 @@ export type EventFrame = {
|
|
|
14
14
|
post_context?: string[];
|
|
15
15
|
context_line?: string;
|
|
16
16
|
vars?: FrameVars;
|
|
17
|
+
instruction_addr?: string;
|
|
17
18
|
in_app?: boolean;
|
|
18
19
|
};
|
|
19
20
|
export type EventStacktrace = {
|
|
@@ -107,7 +108,59 @@ export type SentryTransactionEvent = CommonEventAttrs & {
|
|
|
107
108
|
trace: TraceContext;
|
|
108
109
|
};
|
|
109
110
|
};
|
|
110
|
-
export type
|
|
111
|
+
export type ProfileSample = {
|
|
112
|
+
elapsed_since_start_ns: string;
|
|
113
|
+
stack_id: number;
|
|
114
|
+
thread_id: string;
|
|
115
|
+
};
|
|
116
|
+
export type ProcessedProfileSample = {
|
|
117
|
+
start_timestamp: number;
|
|
118
|
+
stack_id: number;
|
|
119
|
+
thread_id: string;
|
|
120
|
+
};
|
|
121
|
+
export type SentryProfile = {
|
|
122
|
+
samples: ProfileSample[];
|
|
123
|
+
stacks: number[][];
|
|
124
|
+
frames: EventFrame[];
|
|
125
|
+
platform?: string;
|
|
126
|
+
thread_metadata: Record<string, {
|
|
127
|
+
name?: string;
|
|
128
|
+
priority?: number;
|
|
129
|
+
}>;
|
|
130
|
+
};
|
|
131
|
+
export type SentryProcessedProfile = SentryProfile & {
|
|
132
|
+
samples: ProcessedProfileSample[];
|
|
133
|
+
};
|
|
134
|
+
export type SentryDeviceInfo = {
|
|
135
|
+
architecture: string;
|
|
136
|
+
is_emulator?: boolean;
|
|
137
|
+
locale?: string;
|
|
138
|
+
manufacturer?: string;
|
|
139
|
+
model?: string;
|
|
140
|
+
};
|
|
141
|
+
export type SentryOSInfo = {
|
|
142
|
+
name: string;
|
|
143
|
+
version: string;
|
|
144
|
+
build_number?: string;
|
|
145
|
+
};
|
|
146
|
+
export type SentryProfileTransactionInfo = {
|
|
147
|
+
name: string;
|
|
148
|
+
id: string;
|
|
149
|
+
trace_id: string;
|
|
150
|
+
active_thread_id: string;
|
|
151
|
+
relative_start_ns?: string;
|
|
152
|
+
relative_end_ns?: string;
|
|
153
|
+
};
|
|
154
|
+
export type SentryProfileV1Event = CommonEventAttrs & {
|
|
155
|
+
type: 'profile';
|
|
156
|
+
device: SentryDeviceInfo;
|
|
157
|
+
os: SentryOSInfo;
|
|
158
|
+
transactions?: Array<SentryProfileTransactionInfo>;
|
|
159
|
+
transaction?: SentryProfileTransactionInfo;
|
|
160
|
+
version: '1';
|
|
161
|
+
profile: SentryProfile;
|
|
162
|
+
};
|
|
163
|
+
export type SentryEvent = SentryErrorEvent | SentryTransactionEvent | SentryProfileV1Event;
|
|
111
164
|
export type Trace = TraceContext & {
|
|
112
165
|
transactions: SentryTransactionEvent[];
|
|
113
166
|
errors: number;
|
|
@@ -116,8 +169,9 @@ export type Trace = TraceContext & {
|
|
|
116
169
|
status: string;
|
|
117
170
|
rootTransaction: SentryTransactionEvent | null;
|
|
118
171
|
rootTransactionName: string;
|
|
119
|
-
spans: Span
|
|
172
|
+
spans: Map<string, Span>;
|
|
120
173
|
spanTree: Span[];
|
|
174
|
+
profileGrafted: boolean;
|
|
121
175
|
};
|
|
122
176
|
export type Sdk = {
|
|
123
177
|
name: string;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
export declare const SECOND = 1000;
|
|
2
|
-
export declare const MINUTE = 60000;
|
|
3
|
-
export declare const HOUR = 3600000;
|
|
4
|
-
export declare const DAY = 86400000;
|
|
5
|
-
export declare const WEEK = 604800000;
|
|
6
|
-
export declare const MONTH = 2629800000;
|
|
7
|
-
export declare const YEAR = 31557600000;
|
|
8
1
|
export declare const DURATION_LABELS: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ms: string;
|
|
2
|
+
31557600000: string;
|
|
3
|
+
2629800000: string;
|
|
4
|
+
604800000: string;
|
|
5
|
+
86400000: string;
|
|
6
|
+
3600000: string;
|
|
7
|
+
60000: string;
|
|
8
|
+
1000: string;
|
|
17
9
|
};
|
|
18
|
-
export declare function getDuration(start: string | number, end: string | number): number;
|
|
19
10
|
export declare function getSpanDurationClassName(duration: number): "text-red-400" | "text-orange-400" | "text-yellow-400" | undefined;
|
|
20
11
|
export declare function getFormattedNumber(num: number, decimalPlaces?: number): string;
|
|
21
12
|
export declare function getFormattedDuration(duration: number): string;
|
|
13
|
+
export declare function getFormattedSpanDuration(span: {
|
|
14
|
+
timestamp: number;
|
|
15
|
+
start_timestamp: number;
|
|
16
|
+
}): string;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { Span } from '../types';
|
|
2
2
|
|
|
3
|
-
export declare function groupSpans(spans: Span
|
|
3
|
+
export declare function groupSpans(spans: Map<string, Span>): Span[];
|
|
4
|
+
export declare function compareSpans(a: {
|
|
5
|
+
start_timestamp: number;
|
|
6
|
+
}, b: {
|
|
7
|
+
start_timestamp: number;
|
|
8
|
+
}): number;
|