Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/migration/draft-v9-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
});
```

## `@sentry/remix`

- Deprecated `autoInstrumentRemix: false`. The next major version will default to behaving as if this option were `true` and the option itself will be removed.

## Server-side SDKs (`@sentry/node` and all dependents)

- Deprecated `processThreadBreadcrumbIntegration` in favor of `childProcessIntegration`. Functionally they are the same.
Expand Down
1 change: 1 addition & 0 deletions packages/remix/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export function getRemixDefaultIntegrations(options: RemixOptions): Integration[
return [
...getDefaultNodeIntegrations(options as NodeOptions).filter(integration => integration.name !== 'Http'),
httpIntegration(),
// eslint-disable-next-line deprecation/deprecation
options.autoInstrumentRemix ? remixIntegration() : undefined,
].filter(int => int) as Integration[];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/remix/src/utils/instrumentServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ export function instrumentBuild(
build: ServerBuild | (() => ServerBuild | Promise<ServerBuild>),
options: RemixOptions,
): ServerBuild | (() => ServerBuild | Promise<ServerBuild>) {
// eslint-disable-next-line deprecation/deprecation
const autoInstrumentRemix = options?.autoInstrumentRemix || false;

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

// eslint-disable-next-line deprecation/deprecation
return wrapRequestHandler(requestHandler, newBuild, options.autoInstrumentRemix || false);
};
};
Expand Down
21 changes: 19 additions & 2 deletions packages/remix/src/utils/remixOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,22 @@ import type { Options } from '@sentry/types';

export type RemixOptions = (Options | BrowserOptions | NodeOptions) & {
captureActionFormDataKeys?: Record<string, string | boolean>;
autoInstrumentRemix?: boolean;
};
} & (
| {
/**
* Enables OpenTelemetry Remix instrumentation.
*
* Note: This option will be the default behavior and will be removed in the next major version.
*/
autoInstrumentRemix?: true;
}
| {
/**
* Enables OpenTelemetry Remix instrumentation
*
* @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.
* It is recommended to set this option to `true`.
*/
autoInstrumentRemix?: false;
}
);
Loading