Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disableInstrumentation option to next.config.js #75328

Draft
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

JamesRobertWiseman
Copy link

Add disableInstrumentation configuration option to control environment-specific instrumentation.

  • Configuration Changes

    • Add disableInstrumentation to the NextConfig type definition in packages/next/src/server/config-shared.ts.
    • Add disableInstrumentation to the defaultConfig object in packages/next/src/server/config-shared.ts with a default value of false.
    • Add logic to handle the disableInstrumentation option in the assignDefaults function in packages/next/src/server/config.ts.
  • Instrumentation Control

    • Add a check for the disableInstrumentation option in the runInstrumentationHookIfAvailable function in packages/next/src/server/next-server.ts.
    • Skip the instrumentation registration if disableInstrumentation is true in packages/next/src/server/next-server.ts.
  • Example

    • Add an example of using the disableInstrumentation option in the next.config.js file in examples/basic-app/next.config.js.

Add `disableInstrumentation` configuration option to control environment-specific instrumentation.

* **Configuration Changes**
  - Add `disableInstrumentation` to the `NextConfig` type definition in `packages/next/src/server/config-shared.ts`.
  - Add `disableInstrumentation` to the `defaultConfig` object in `packages/next/src/server/config-shared.ts` with a default value of `false`.
  - Add logic to handle the `disableInstrumentation` option in the `assignDefaults` function in `packages/next/src/server/config.ts`.

* **Instrumentation Control**
  - Add a check for the `disableInstrumentation` option in the `runInstrumentationHookIfAvailable` function in `packages/next/src/server/next-server.ts`.
  - Skip the instrumentation registration if `disableInstrumentation` is `true` in `packages/next/src/server/next-server.ts`.

* **Example**
  - Add an example of using the `disableInstrumentation` option in the `next.config.js` file in `examples/basic-app/next.config.js`.
@ijjk ijjk added examples Issue was opened via the examples template. type: next labels Jan 26, 2025
Copy link

vercel bot commented Jan 26, 2025

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @huozhi:

packages/next/src/server/config.ts

@ijjk
Copy link
Member

ijjk commented Jan 26, 2025

Allow CI Workflow Run

  • approve CI run for commit: e87c74d

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@ijjk
Copy link
Member

ijjk commented Jan 26, 2025

Allow CI Workflow Run

  • approve CI run for commit: e87c74d

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@JamesRobertWiseman JamesRobertWiseman marked this pull request as draft January 27, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Issue was opened via the examples template. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants