Skip to content

Commit a11630e

Browse files
authored
feat(remix): Deprecate autoInstrumentRemix: false (#14508)
1 parent f82a570 commit a11630e

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

docs/migration/draft-v9-migration-guide.md

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@
8888
});
8989
```
9090

91+
## `@sentry/remix`
92+
93+
- Deprecated `autoInstrumentRemix: false`. The next major version will default to behaving as if this option were `true` and the option itself will be removed.
94+
9195
## Server-side SDKs (`@sentry/node` and all dependents)
9296

9397
- Deprecated `processThreadBreadcrumbIntegration` in favor of `childProcessIntegration`. Functionally they are the same.

packages/remix/src/index.server.ts

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export function getRemixDefaultIntegrations(options: RemixOptions): Integration[
168168
return [
169169
...getDefaultNodeIntegrations(options as NodeOptions).filter(integration => integration.name !== 'Http'),
170170
httpIntegration(),
171+
// eslint-disable-next-line deprecation/deprecation
171172
options.autoInstrumentRemix ? remixIntegration() : undefined,
172173
].filter(int => int) as Integration[];
173174
}

packages/remix/src/utils/instrumentServer.ts

+2
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ export function instrumentBuild(
399399
build: ServerBuild | (() => ServerBuild | Promise<ServerBuild>),
400400
options: RemixOptions,
401401
): ServerBuild | (() => ServerBuild | Promise<ServerBuild>) {
402+
// eslint-disable-next-line deprecation/deprecation
402403
const autoInstrumentRemix = options?.autoInstrumentRemix || false;
403404

404405
if (typeof build === 'function') {
@@ -434,6 +435,7 @@ const makeWrappedCreateRequestHandler = (options: RemixOptions) =>
434435
const newBuild = instrumentBuild(build, options);
435436
const requestHandler = origCreateRequestHandler.call(this, newBuild, ...args);
436437

438+
// eslint-disable-next-line deprecation/deprecation
437439
return wrapRequestHandler(requestHandler, newBuild, options.autoInstrumentRemix || false);
438440
};
439441
};

packages/remix/src/utils/remixOptions.ts

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,22 @@ import type { Options } from '@sentry/types';
44

55
export type RemixOptions = (Options | BrowserOptions | NodeOptions) & {
66
captureActionFormDataKeys?: Record<string, string | boolean>;
7-
autoInstrumentRemix?: boolean;
8-
};
7+
} & (
8+
| {
9+
/**
10+
* Enables OpenTelemetry Remix instrumentation.
11+
*
12+
* Note: This option will be the default behavior and will be removed in the next major version.
13+
*/
14+
autoInstrumentRemix?: true;
15+
}
16+
| {
17+
/**
18+
* Enables OpenTelemetry Remix instrumentation
19+
*
20+
* @deprecated Setting this option to `false` is deprecated as the next major version will default to behaving as if this option were `true` and the option itself will be removed.
21+
* It is recommended to set this option to `true`.
22+
*/
23+
autoInstrumentRemix?: false;
24+
}
25+
);

0 commit comments

Comments
 (0)