@sentry/types 7.105.0 → 8.0.0-alpha.1

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 (58) hide show
  1. package/package.json +2 -2
  2. package/types/attachment.d.ts +22 -1
  3. package/types/attachment.d.ts.map +1 -1
  4. package/types/breadcrumb.d.ts +2 -2
  5. package/types/breadcrumb.d.ts.map +1 -1
  6. package/types/client.d.ts +54 -51
  7. package/types/client.d.ts.map +1 -1
  8. package/types/datacategory.d.ts +1 -1
  9. package/types/datacategory.d.ts.map +1 -1
  10. package/types/envelope.d.ts +2 -13
  11. package/types/envelope.d.ts.map +1 -1
  12. package/types/event.d.ts +2 -2
  13. package/types/event.d.ts.map +1 -1
  14. package/types/hub.d.ts +3 -34
  15. package/types/hub.d.ts.map +1 -1
  16. package/types/index.d.ts +2 -4
  17. package/types/index.d.ts.map +1 -1
  18. package/types/integration.d.ts +2 -6
  19. package/types/integration.d.ts.map +1 -1
  20. package/types/options.d.ts +22 -22
  21. package/types/options.d.ts.map +1 -1
  22. package/types/scope.d.ts +10 -6
  23. package/types/scope.d.ts.map +1 -1
  24. package/types/severity.d.ts +0 -18
  25. package/types/severity.d.ts.map +1 -1
  26. package/types/span.d.ts +16 -198
  27. package/types/span.d.ts.map +1 -1
  28. package/types/startSpanOptions.d.ts +0 -10
  29. package/types/startSpanOptions.d.ts.map +1 -1
  30. package/types/transaction.d.ts +20 -40
  31. package/types/transaction.d.ts.map +1 -1
  32. package/types/transport.d.ts +0 -2
  33. package/types/transport.d.ts.map +1 -1
  34. package/types/user.d.ts +0 -4
  35. package/types/user.d.ts.map +1 -1
  36. package/types-ts3.8/attachment.d.ts +22 -1
  37. package/types-ts3.8/breadcrumb.d.ts +2 -2
  38. package/types-ts3.8/client.d.ts +54 -51
  39. package/types-ts3.8/datacategory.d.ts +1 -1
  40. package/types-ts3.8/envelope.d.ts +2 -13
  41. package/types-ts3.8/event.d.ts +2 -2
  42. package/types-ts3.8/hub.d.ts +3 -34
  43. package/types-ts3.8/index.d.ts +2 -4
  44. package/types-ts3.8/integration.d.ts +2 -6
  45. package/types-ts3.8/options.d.ts +22 -22
  46. package/types-ts3.8/scope.d.ts +10 -6
  47. package/types-ts3.8/severity.d.ts +0 -18
  48. package/types-ts3.8/span.d.ts +16 -198
  49. package/types-ts3.8/startSpanOptions.d.ts +0 -10
  50. package/types-ts3.8/transaction.d.ts +20 -40
  51. package/types-ts3.8/transport.d.ts +0 -2
  52. package/types-ts3.8/user.d.ts +0 -4
  53. package/types/instrumenter.d.ts +0 -2
  54. package/types/instrumenter.d.ts.map +0 -1
  55. package/types/textencoder.d.ts +0 -15
  56. package/types/textencoder.d.ts.map +0 -1
  57. package/types-ts3.8/instrumenter.d.ts +0 -2
  58. package/types-ts3.8/textencoder.d.ts +0 -15
@@ -6,7 +6,7 @@ export { Context, Contexts, DeviceContext, OsContext, AppContext, CultureContext
6
6
  export { DataCategory } from './datacategory';
7
7
  export { DsnComponents, DsnLike, DsnProtocol } from './dsn';
8
8
  export { DebugImage, DebugMeta } from './debugMeta';
9
- export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, StatsdItem, StatsdEnvelope, ProfileItem, SpanEnvelope, SpanItem, } from './envelope';
9
+ export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, StatsdItem, StatsdEnvelope, ProfileItem, } from './envelope';
10
10
  export { ExtendedError } from './error';
11
11
  export { Event, EventHint, EventType, ErrorEvent, TransactionEvent, SerializedEvent } from './event';
12
12
  export { EventProcessor } from './eventprocessor';
@@ -28,11 +28,10 @@ export { CaptureContext, Scope, ScopeContext, ScopeData } from './scope';
28
28
  export { SdkInfo } from './sdkinfo';
29
29
  export { SdkMetadata } from './sdkmetadata';
30
30
  export { SessionAggregates, AggregationCounts, Session, SessionContext, SessionStatus, RequestSession, RequestSessionStatus, SessionFlusherLike, SerializedSession, } from './session';
31
- export { Severity, SeverityLevel } from './severity';
31
+ export { SeverityLevel } from './severity';
32
32
  export { Span, SpanContext, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, MetricSummary, } from './span';
33
33
  export { StackFrame } from './stackframe';
34
34
  export { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';
35
- export { TextEncoderInternal } from './textencoder';
36
35
  export { PropagationContext, TracePropagationTargets } from './tracing';
37
36
  export { StartSpanOptions } from './startSpanOptions';
38
37
  export { CustomSamplingContext, SamplingContext, TraceparentData, Transaction, TransactionContext, TransactionMetadata, TransactionSource, } from './transaction';
@@ -42,7 +41,6 @@ export { Transport, TransportRequest, TransportMakeRequestResponse, InternalBase
42
41
  export { User, UserFeedback } from './user';
43
42
  export { WebFetchHeaders, WebFetchRequest } from './webfetchapi';
44
43
  export { WrappedFunction } from './wrappedfunction';
45
- export { Instrumenter } from './instrumenter';
46
44
  export { HandlerDataFetch, HandlerDataXhr, HandlerDataDom, HandlerDataConsole, HandlerDataHistory, HandlerDataError, HandlerDataUnhandledRejection, ConsoleLevel, SentryXhrData, SentryWrappedXMLHttpRequest, } from './instrument';
47
45
  export { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './browseroptions';
48
46
  export { CheckIn, MonitorConfig, FinishedCheckIn, InProgressCheckIn, SerializedCheckIn } from './checkin';
@@ -20,10 +20,8 @@ export interface IntegrationFnResult {
20
20
  /**
21
21
  * This hook is only called once, even if multiple clients are created.
22
22
  * It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
23
- *
24
- * NOTE: In v8, this will become optional.
25
23
  */
26
- setupOnce(): void;
24
+ setupOnce?(): void;
27
25
  /**
28
26
  * Set up an integration for the given client.
29
27
  * Receives the client as argument.
@@ -63,10 +61,8 @@ export interface Integration {
63
61
  /**
64
62
  * This hook is only called once, even if multiple clients are created.
65
63
  * It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
66
- *
67
- * NOTE: In v8, this will become optional, and not receive any arguments anymore.
68
64
  */
69
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
65
+ setupOnce?(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
70
66
  /**
71
67
  * Set up an integration for the given client.
72
68
  * Receives the client as argument.
@@ -1,6 +1,5 @@
1
1
  import { Breadcrumb, BreadcrumbHint } from './breadcrumb';
2
2
  import { ErrorEvent, Event, EventHint, TransactionEvent } from './event';
3
- import { Instrumenter } from './instrumenter';
4
3
  import { Integration } from './integration';
5
4
  import { CaptureContext } from './scope';
6
5
  import { SdkMetadata } from './sdkmetadata';
@@ -49,14 +48,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
49
48
  * List of integrations that should be installed after SDK was initialized.
50
49
  */
51
50
  integrations: Integration[];
52
- /**
53
- * The instrumenter to use. Defaults to `sentry`.
54
- * When not set to `sentry`, auto-instrumentation inside of Sentry will be disabled,
55
- * in favor of using external auto instrumentation.
56
- *
57
- * NOTE: Any option except for `sentry` is highly experimental and subject to change!
58
- */
59
- instrumenter?: Instrumenter;
60
51
  /**
61
52
  * A function that takes transport options and returns the Transport object which is used to send events to Sentry.
62
53
  * The function is invoked internally when the client is initialized.
@@ -191,22 +182,31 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
191
182
  */
192
183
  denyUrls?: Array<string | RegExp>;
193
184
  /**
194
- * List of strings/regex controlling to which outgoing requests
195
- * the SDK will attach tracing headers.
185
+ * List of strings and/or Regular Expressions used to determine which outgoing requests will have `sentry-trace` and `baggage`
186
+ * headers attached.
187
+ *
188
+ * **Default:** If this option is not provided, tracing headers will be attached to all outgoing requests.
189
+ * If you are using a browser SDK, by default, tracing headers will only be attached to outgoing requests to the same origin.
190
+ *
191
+ * **Disclaimer:** Carelessly setting this option in browser environments may result into CORS errors!
192
+ * Only attach tracing headers to requests to the same origin, or to requests to services you can control CORS headers of.
193
+ * Cross-origin requests, meaning requests to a different domain, for example a request to `https://api.example.com/` while you're on `https://example.com/`, take special care.
194
+ * If you are attaching headers to cross-origin requests, make sure the backend handling the request returns a `"Access-Control-Allow-Headers: sentry-trace, baggage"` header to ensure your requests aren't blocked.
196
195
  *
197
- * By default the SDK will attach those headers to all requests to localhost
198
- * and same origin. If this option is provided, the SDK will match the
199
- * request URL of outgoing requests against the items in this
200
- * array, and only attach tracing headers if a match was found.
196
+ * If you provide a `tracePropagationTargets` array, the entries you provide will be matched against the entire URL of the outgoing request.
197
+ * If you are using a browser SDK, the entries will also be matched against the pathname of the outgoing requests.
198
+ * This is so you can have matchers for relative requests, for example, `/^\/api/` if you want to trace requests to your `/api` routes on the same domain.
201
199
  *
202
- * @example
203
- * ```js
204
- * Sentry.init({
205
- * tracePropagationTargets: ['api.site.com'],
206
- * });
207
- * ```
200
+ * If any of the two match any of the provided values, tracing headers will be attached to the outgoing request.
201
+ * Both, the string values, and the RegExes you provide in the array will match if they partially match the URL or pathname.
208
202
  *
209
- * Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS}
203
+ * Examples:
204
+ * - `tracePropagationTargets: [/^\/api/]` and request to `https://same-origin.com/api/posts`:
205
+ * - Tracing headers will be attached because the request is sent to the same origin and the regex matches the pathname "/api/posts".
206
+ * - `tracePropagationTargets: [/^\/api/]` and request to `https://different-origin.com/api/posts`:
207
+ * - Tracing headers will not be attached because the pathname will only be compared when the request target lives on the same origin.
208
+ * - `tracePropagationTargets: [/^\/api/, 'https://external-api.com']` and request to `https://external-api.com/v1/data`:
209
+ * - Tracing headers will be attached because the request URL matches the string `'https://external-api.com'`.
210
210
  */
211
211
  tracePropagationTargets?: TracePropagationTargets;
212
212
  /**
@@ -7,7 +7,7 @@ import { EventProcessor } from './eventprocessor';
7
7
  import { Extra, Extras } from './extra';
8
8
  import { Primitive } from './misc';
9
9
  import { RequestSession, Session } from './session';
10
- import { Severity, SeverityLevel } from './severity';
10
+ import { SeverityLevel } from './severity';
11
11
  import { Span } from './span';
12
12
  import { PropagationContext } from './tracing';
13
13
  import { Transaction } from './transaction';
@@ -17,7 +17,7 @@ export type CaptureContext = Scope | Partial<ScopeContext> | ((scope: Scope) =>
17
17
  /** JSDocs */
18
18
  export interface ScopeContext {
19
19
  user: User;
20
- level: Severity | SeverityLevel;
20
+ level: SeverityLevel;
21
21
  extra: Extras;
22
22
  contexts: Contexts;
23
23
  tags: {
@@ -48,7 +48,7 @@ export interface ScopeData {
48
48
  span?: Span;
49
49
  }
50
50
  /**
51
- * Holds additional event information. {@link Scope.applyToEvent} will be called by the client before an event is sent.
51
+ * Holds additional event information.
52
52
  */
53
53
  export interface Scope {
54
54
  /**
@@ -60,8 +60,8 @@ export interface Scope {
60
60
  *
61
61
  * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.
62
62
  */
63
- getClient(): Client | undefined;
64
- /** Add new event processor that will be called after {@link applyToEvent}. */
63
+ getClient<C extends Client>(): C | undefined;
64
+ /** Add new event processor that will be called during event processing. */
65
65
  addEventProcessor(callback: EventProcessor): this;
66
66
  /** Get the data of this scope, which is applied to an event during processing. */
67
67
  getScopeData(): ScopeData;
@@ -111,7 +111,7 @@ export interface Scope {
111
111
  * Sets the level on the scope for future events.
112
112
  * @param level string {@link SeverityLevel}
113
113
  */
114
- setLevel(level: Severity | SeverityLevel): this;
114
+ setLevel(level: SeverityLevel): this;
115
115
  /**
116
116
  * Sets the transaction name on the scope for future events.
117
117
  * @deprecated Use extra or tags instead.
@@ -231,5 +231,9 @@ export interface Scope {
231
231
  * @returns the id of the captured event.
232
232
  */
233
233
  captureEvent(event: Event, hint?: EventHint): string;
234
+ /**
235
+ * Clone all data from this scope into a new scope.
236
+ */
237
+ clone(): Scope;
234
238
  }
235
239
  //# sourceMappingURL=scope.d.ts.map
@@ -1,20 +1,2 @@
1
- /**
2
- * @deprecated Please use a `SeverityLevel` string instead of the `Severity` enum. Acceptable values are 'fatal',
3
- * 'error', 'warning', 'log', 'info', and 'debug'.
4
- */
5
- export declare enum Severity {
6
- /** JSDoc */
7
- Fatal = "fatal",
8
- /** JSDoc */
9
- Error = "error",
10
- /** JSDoc */
11
- Warning = "warning",
12
- /** JSDoc */
13
- Log = "log",
14
- /** JSDoc */
15
- Info = "info",
16
- /** JSDoc */
17
- Debug = "debug"
18
- }
19
1
  export type SeverityLevel = 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug';
20
2
  //# sourceMappingURL=severity.d.ts.map
@@ -1,9 +1,6 @@
1
- import { TraceContext } from './context';
2
- import { Instrumenter } from './instrumenter';
3
- import { Measurements } from './measurement';
4
1
  import { Primitive } from './misc';
5
2
  import { HrTime } from './opentelemetry';
6
- import { Transaction } from './transaction';
3
+ import { TransactionSource } from './transaction';
7
4
  type SpanOriginType = 'manual' | 'auto';
8
5
  type SpanOriginCategory = string;
9
6
  type SpanOriginIntegrationName = string;
@@ -13,7 +10,7 @@ export type SpanAttributeValue = string | number | boolean | Array<null | undefi
13
10
  export type SpanAttributes = Partial<{
14
11
  'sentry.origin': string;
15
12
  'sentry.op': string;
16
- 'sentry.source': string;
13
+ 'sentry.source': TransactionSource;
17
14
  'sentry.sample_rate': number;
18
15
  }> & Record<string, SpanAttributeValue | undefined>;
19
16
  export type MetricSummary = {
@@ -44,8 +41,8 @@ export interface SpanJSON {
44
41
  origin?: SpanOrigin;
45
42
  _metrics_summary?: Record<string, Array<MetricSummary>>;
46
43
  }
47
- type TraceFlagNone = 0x0;
48
- type TraceFlagSampled = 0x1;
44
+ type TraceFlagNone = 0;
45
+ type TraceFlagSampled = 1;
49
46
  export type TraceFlag = TraceFlagNone | TraceFlagSampled;
50
47
  export interface SpanContextData {
51
48
  /**
@@ -72,30 +69,23 @@ export interface SpanContextData {
72
69
  * sampled or not. When set, the least significant bit documents that the
73
70
  * caller may have recorded trace data. A caller who does not record trace
74
71
  * data out-of-band leaves this flag unset.
72
+ * We allow number here because otel also does, so we can't be stricter than them.
75
73
  */
76
- traceFlags: TraceFlag;
74
+ traceFlags: TraceFlag | number;
77
75
  }
78
- /** Interface holding all properties that can be set on a Span on creation. */
76
+ /**
77
+ * Interface holding all properties that can be set on a Span on creation.
78
+ * This is only used for the legacy span/transaction creation and will go away in v8.
79
+ */
79
80
  export interface SpanContext {
80
81
  /**
81
- * Description of the Span.
82
- *
83
- * @deprecated Use `name` instead.
84
- */
85
- description?: string | undefined;
86
- /**
87
- * Human-readable identifier for the span. Alias for span.description.
82
+ * Human-readable identifier for the span.
88
83
  */
89
84
  name?: string | undefined;
90
85
  /**
91
86
  * Operation of the Span.
92
87
  */
93
88
  op?: string | undefined;
94
- /**
95
- * Completion status of the Span.
96
- * See: {@sentry/tracing SpanStatus} for possible values
97
- */
98
- status?: string | undefined;
99
89
  /**
100
90
  * Parent Span ID
101
91
  */
@@ -138,146 +128,24 @@ export interface SpanContext {
138
128
  * Timestamp in seconds (epoch time) indicating when the span ended.
139
129
  */
140
130
  endTimestamp?: number | undefined;
141
- /**
142
- * The instrumenter that created this span.
143
- */
144
- instrumenter?: Instrumenter | undefined;
145
131
  /**
146
132
  * The origin of the span, giving context about what created the span.
147
133
  */
148
134
  origin?: SpanOrigin | undefined;
149
- /**
150
- * Exclusive time in milliseconds.
151
- */
152
- exclusiveTime?: number;
153
- /**
154
- * Measurements of the Span.
155
- */
156
- measurements?: Measurements;
157
135
  }
158
- /** Span holding trace_id, span_id */
159
- export interface Span extends Pick<SpanContext, Exclude<keyof SpanContext, 'op' | 'status' | 'origin'>> {
160
- /**
161
- * Human-readable identifier for the span. Identical to span.description.
162
- * @deprecated Use `spanToJSON(span).description` instead.
163
- */
164
- name: string;
165
- /**
166
- * Operation of the Span.
167
- *
168
- * @deprecated Use `startSpan()` functions to set, `span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'op')
169
- * to update and `spanToJSON().op` to read the op instead
170
- */
171
- op?: string | undefined;
172
- /**
173
- * The ID of the span.
174
- * @deprecated Use `spanContext().spanId` instead.
175
- */
176
- spanId: string;
177
- /**
178
- * Parent Span ID
179
- *
180
- * @deprecated Use `spanToJSON(span).parent_span_id` instead.
181
- */
182
- parentSpanId?: string | undefined;
183
- /**
184
- * The ID of the trace.
185
- * @deprecated Use `spanContext().traceId` instead.
186
- */
187
- traceId: string;
188
- /**
189
- * Was this span chosen to be sent as part of the sample?
190
- * @deprecated Use `isRecording()` instead.
191
- */
192
- sampled?: boolean | undefined;
193
- /**
194
- * Timestamp in seconds (epoch time) indicating when the span started.
195
- * @deprecated Use `spanToJSON()` instead.
196
- */
197
- startTimestamp: number;
198
- /**
199
- * Timestamp in seconds (epoch time) indicating when the span ended.
200
- * @deprecated Use `spanToJSON()` instead.
201
- */
202
- endTimestamp?: number | undefined;
203
- /**
204
- * Tags for the span.
205
- * @deprecated Use `spanToJSON(span).atttributes` instead.
206
- */
207
- tags: {
208
- [key: string]: Primitive;
209
- };
210
- /**
211
- * Data for the span.
212
- * @deprecated Use `spanToJSON(span).atttributes` instead.
213
- */
214
- data: {
215
- [key: string]: any;
216
- };
217
- /**
218
- * Attributes for the span.
219
- * @deprecated Use `spanToJSON(span).atttributes` instead.
220
- */
221
- attributes: SpanAttributes;
222
- /**
223
- * The transaction containing this span
224
- * @deprecated Use top level `Sentry.getRootSpan()` instead
225
- */
226
- transaction?: Transaction;
227
- /**
228
- * The instrumenter that created this span.
229
- *
230
- * @deprecated this field will be removed.
231
- */
232
- instrumenter: Instrumenter;
233
- /**
234
- * Completion status of the Span.
235
- *
236
- * See: {@sentry/tracing SpanStatus} for possible values
237
- *
238
- * @deprecated Use `.setStatus` to set or update and `spanToJSON()` to read the status.
239
- */
240
- status?: string | undefined;
241
- /**
242
- * The origin of the span, giving context about what created the span.
243
- *
244
- * @deprecated Use `startSpan` function to set and `spanToJSON(span).origin` to read the origin instead.
245
- */
246
- origin?: SpanOrigin | undefined;
136
+ /**
137
+ * A generic Span which holds trace data.
138
+ */
139
+ export interface Span {
247
140
  /**
248
141
  * Get context data for this span.
249
142
  * This includes the spanId & the traceId.
250
143
  */
251
144
  spanContext(): SpanContextData;
252
- /**
253
- * Sets the finish timestamp on the current span.
254
- *
255
- * @param endTimestamp Takes an endTimestamp if the end should not be the time when you call this function.
256
- *
257
- * @deprecated Use `.end()` instead.
258
- */
259
- finish(endTimestamp?: number): void;
260
145
  /**
261
146
  * End the current span.
262
147
  */
263
148
  end(endTimestamp?: SpanTimeInput): void;
264
- /**
265
- * Sets the tag attribute on the current span.
266
- *
267
- * Can also be used to unset a tag, by passing `undefined`.
268
- *
269
- * @param key Tag key
270
- * @param value Tag value
271
- * @deprecated Use `setAttribute()` instead.
272
- */
273
- setTag(key: string, value: Primitive): this;
274
- /**
275
- * Sets the data attribute on the current span
276
- * @param key Data key
277
- * @param value Data value
278
- * @deprecated Use `setAttribute()` instead.
279
- */
280
- setData(key: string, value: any): this;
281
149
  /**
282
150
  * Set a single attribute on the span.
283
151
  * Set it to `undefined` to remove the attribute.
@@ -290,64 +158,14 @@ export interface Span extends Pick<SpanContext, Exclude<keyof SpanContext, 'op'
290
158
  setAttributes(attributes: SpanAttributes): void;
291
159
  /**
292
160
  * Sets the status attribute on the current span
293
- * See: {@sentry/tracing SpanStatus} for possible values
161
+ * See: {@sentry/core SpanStatusType} for possible values
294
162
  * @param status http code used to set the status
295
163
  */
296
164
  setStatus(status: string): this;
297
- /**
298
- * Sets the status attribute on the current span based on the http code
299
- * @param httpStatus http code used to set the status
300
- * @deprecated Use top-level `setHttpStatus()` instead.
301
- */
302
- setHttpStatus(httpStatus: number): this;
303
- /**
304
- * Set the name of the span.
305
- *
306
- * @deprecated Use `updateName()` instead.
307
- */
308
- setName(name: string): void;
309
165
  /**
310
166
  * Update the name of the span.
311
167
  */
312
168
  updateName(name: string): this;
313
- /**
314
- * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
315
- * Also the `sampled` decision will be inherited.
316
- *
317
- * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.
318
- */
319
- startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
320
- /**
321
- * Determines whether span was successful (HTTP200)
322
- *
323
- * @deprecated Use `spanToJSON(span).status === 'ok'` instead.
324
- */
325
- isSuccess(): boolean;
326
- /**
327
- * Return a traceparent compatible header string.
328
- * @deprecated Use `spanToTraceHeader()` instead.
329
- */
330
- toTraceparent(): string;
331
- /**
332
- * Returns the current span properties as a `SpanContext`.
333
- * @deprecated Use `toJSON()` or access the fields directly instead.
334
- */
335
- toContext(): SpanContext;
336
- /**
337
- * Updates the current span with a new `SpanContext`.
338
- * @deprecated Update the fields directly instead.
339
- */
340
- updateWithContext(spanContext: SpanContext): this;
341
- /**
342
- * Convert the object to JSON for w. spans array info only.
343
- * @deprecated Use `spanToTraceContext()` util function instead.
344
- */
345
- getTraceContext(): TraceContext;
346
- /**
347
- * Convert the object to JSON.
348
- * @deprecated Use `spanToJSON(span)` instead.
349
- */
350
- toJSON(): SpanJSON;
351
169
  /**
352
170
  * If this is span is actually recording data.
353
171
  * This will return false if tracing is disabled, this span was not sampled or if the span is already finished.
@@ -1,4 +1,3 @@
1
- import { Instrumenter } from './instrumenter';
2
1
  import { Primitive } from './misc';
3
2
  import { Scope } from './scope';
4
3
  import { SpanAttributes, SpanOrigin, SpanTimeInput } from './span';
@@ -40,11 +39,6 @@ export interface StartSpanOptions extends TransactionContext {
40
39
  * @deprecated Use attributes or set data on scopes instead.
41
40
  */
42
41
  metadata?: Partial<TransactionMetadata>;
43
- /**
44
- * The name thingy.
45
- * @deprecated Use `name` instead.
46
- */
47
- description?: string;
48
42
  /**
49
43
  * @deprecated Use `span.setStatus()` instead.
50
44
  */
@@ -89,9 +83,5 @@ export interface StartSpanOptions extends TransactionContext {
89
83
  * @deprecated Use `span.end()` instead.
90
84
  */
91
85
  endTimestamp?: number;
92
- /**
93
- * @deprecated You cannot set the instrumenter manually anymore.
94
- */
95
- instrumenter?: Instrumenter;
96
86
  }
97
87
  //# sourceMappingURL=startSpanOptions.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { Context } from './context';
2
2
  import { DynamicSamplingContext } from './envelope';
3
- import { Instrumenter } from './instrumenter';
4
3
  import { MeasurementUnit } from './measurement';
5
4
  import { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc';
6
5
  import { PolymorphicRequest } from './polymorphics';
@@ -33,16 +32,24 @@ export interface TransactionContext extends SpanContext {
33
32
  /**
34
33
  * Data pulled from a `sentry-trace` header
35
34
  */
36
- export type TraceparentData = Pick<TransactionContext, 'traceId' | 'parentSpanId' | 'parentSampled'>;
35
+ export interface TraceparentData {
36
+ /**
37
+ * Trace ID
38
+ */
39
+ traceId?: string | undefined;
40
+ /**
41
+ * Parent Span ID
42
+ */
43
+ parentSpanId?: string | undefined;
44
+ /**
45
+ * If this transaction has a parent, the parent's sampling decision
46
+ */
47
+ parentSampled?: boolean | undefined;
48
+ }
37
49
  /**
38
50
  * Transaction "Class", inherits Span only has `setName`
39
51
  */
40
- export interface Transaction extends TransactionContext, Pick<Span, Exclude<keyof Span, 'setName' | 'name'>> {
41
- /**
42
- * Human-readable identifier for the transaction.
43
- * @deprecated Use `spanToJSON(span).description` instead.
44
- */
45
- name: string;
52
+ export interface Transaction extends Pick<TransactionContext, Exclude<keyof TransactionContext, 'name' | 'op'>>, Span {
46
53
  /**
47
54
  * The ID of the transaction.
48
55
  * @deprecated Use `spanContext().spanId` instead.
@@ -86,18 +93,6 @@ export interface Transaction extends TransactionContext, Pick<Span, Exclude<keyo
86
93
  * @deprecated Use attributes or store data on the scope instead.
87
94
  */
88
95
  metadata: TransactionMetadata;
89
- /**
90
- * The instrumenter that created this transaction.
91
- *
92
- * @deprecated This field will be removed in v8.
93
- */
94
- instrumenter: Instrumenter;
95
- /**
96
- * Set the name of the transaction
97
- *
98
- * @deprecated Use `.updateName()` and `.setAttribute()` instead.
99
- */
100
- setName(name: string, source?: TransactionMetadata['source']): void;
101
96
  /**
102
97
  * Set the context of a transaction event.
103
98
  * @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.
@@ -118,11 +113,6 @@ export interface Transaction extends TransactionContext, Pick<Span, Exclude<keyo
118
113
  * @deprecated Use `toJSON()` or access the fields directly instead.
119
114
  */
120
115
  toContext(): TransactionContext;
121
- /**
122
- * Updates the current transaction with a new `TransactionContext`.
123
- * @deprecated Update the fields directly instead.
124
- */
125
- updateWithContext(transactionContext: TransactionContext): this;
126
116
  /**
127
117
  * Set metadata for this transaction.
128
118
  * @deprecated Use attributes or store data on the scope instead.
@@ -135,10 +125,12 @@ export interface Transaction extends TransactionContext, Pick<Span, Exclude<keyo
135
125
  */
136
126
  getDynamicSamplingContext(): Partial<DynamicSamplingContext>;
137
127
  /**
138
- * Get the profile id from the transaction
139
- * @deprecated Use `toJSON()` or access the fields directly instead.
128
+ * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
129
+ * Also the `sampled` decision will be inherited.
130
+ *
131
+ * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.
140
132
  */
141
- getProfileId(): string | undefined;
133
+ startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
142
134
  }
143
135
  /**
144
136
  * Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
@@ -183,21 +175,9 @@ export interface TransactionMetadata {
183
175
  dynamicSamplingContext?: Partial<DynamicSamplingContext>;
184
176
  /** For transactions tracing server-side request handling, the request being tracked. */
185
177
  request?: PolymorphicRequest;
186
- /** Compatibility shim for transitioning to the `RequestData` integration. The options passed to our Express request
187
- * handler controlling what request data is added to the event.
188
- * TODO (v8): This should go away
189
- */
190
- requestDataOptionsFromExpressHandler?: {
191
- [key: string]: unknown;
192
- };
193
178
  /** For transactions tracing server-side request handling, the path of the request being tracked. */
194
179
  /** TODO: If we rm -rf `instrumentServer`, this can go, too */
195
180
  requestPath?: string;
196
- /**
197
- * Information on how a transaction name was generated.
198
- * @deprecated Use `SEMANTIC_ATTRIBUTE_SENTRY_SOURCE` attribute instead.
199
- */
200
- source: TransactionSource;
201
181
  /**
202
182
  * Metadata for the transaction's spans, keyed by spanId.
203
183
  * @deprecated This will be removed in v8.
@@ -1,6 +1,5 @@
1
1
  import { Client } from './client';
2
2
  import { Envelope } from './envelope';
3
- import { TextEncoderInternal } from './textencoder';
4
3
  export type TransportRequest = {
5
4
  body: string | Uint8Array;
6
5
  };
@@ -15,7 +14,6 @@ export type TransportMakeRequestResponse = {
15
14
  export interface InternalBaseTransportOptions {
16
15
  bufferSize?: number;
17
16
  recordDroppedEvent: Client['recordDroppedEvent'];
18
- textEncoder?: TextEncoderInternal;
19
17
  }
20
18
  export interface BaseTransportOptions extends InternalBaseTransportOptions {
21
19
  url: string;
@@ -7,10 +7,6 @@ export interface User {
7
7
  ip_address?: string;
8
8
  email?: string;
9
9
  username?: string;
10
- /**
11
- * @deprecated Functonality for segment has been removed. Use a custom tag or context instead to capture this information.
12
- */
13
- segment?: string;
14
10
  }
15
11
  export interface UserFeedback {
16
12
  event_id: string;
@@ -1,2 +0,0 @@
1
- export type Instrumenter = 'sentry' | 'otel';
2
- //# sourceMappingURL=instrumenter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instrumenter.d.ts","sourceRoot":"","sources":["../../src/instrumenter.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Vendored type from TS 3.8 `typescript/lib/lib.dom.d.ts`.
3
- *
4
- * Type is vendored in so that users don't have to opt-in to DOM types.
5
- */
6
- export interface TextEncoderCommon {
7
- /**
8
- * Returns "utf-8".
9
- */
10
- readonly encoding: string;
11
- }
12
- export interface TextEncoderInternal extends TextEncoderCommon {
13
- encode(input?: string): Uint8Array;
14
- }
15
- //# sourceMappingURL=textencoder.d.ts.map