Skip to content

feat: Remove Otel from fsIntegration #21654

Open
timfish wants to merge 1 commit into
developfrom
timfish/feat/fs-no-otel
Open

feat: Remove Otel from fsIntegration #21654
timfish wants to merge 1 commit into
developfrom
timfish/feat/fs-no-otel

Conversation

@timfish

@timfish timfish commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

This PR doesn't actually use orchestrion.

Becuase fs in a Node built-in, it is CJS and can therfore be monkey patched like it's 2005.

@timfish timfish requested a review from a team as a code owner June 19, 2026 10:49
@timfish timfish requested review from JPeer264 and mydea and removed request for a team June 19, 2026 10:49
Comment on lines +43 to +45
if (options.enabled === false) return;
if (_isEnabled) return;
_isEnabled = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: If fsIntegration is initialized with { enabled: false }, subsequent calls to enable it will fail because setupOnce is not re-executed.
Severity: HIGH

Suggested Fix

The logic in setupOnce should be adjusted to handle re-enabling. Instead of just checking if the integration is installed, it should also check if it's currently enabled. If it's installed but disabled, the setup logic should proceed to enable it. Alternatively, do not add the integration to installedIntegrations if it's being initialized as disabled.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/node/src/integrations/fs/index.ts#L43-L45

Potential issue: When `fsIntegration({ enabled: false })` is called, the integration is
marked as installed but returns early before instrumentation is applied. Because the
integration name is now in `installedIntegrations`, any subsequent call to
`fsIntegration()` (e.g., with the default `enabled: true`) will not re-run `setupOnce`.
This prevents `enableFsInstrumentation` from ever being called, permanently disabling
`fs` instrumentation for the application's lifecycle.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same issue existed with the previous iteration on the intrumentation

@mydea

mydea commented Jun 19, 2026

Copy link
Copy Markdown
Member

Becuase fs in a Node built-in, it is CJS and can therfore be monkey patched like it's 2005.

Ah, simpler (better?) times...

@nicohrubec nicohrubec self-requested a review June 19, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite @opentelemetry/instrumentation-fs to orchestrion

2 participants