feat: Remove Otel from fsIntegration #21654
Conversation
| if (options.enabled === false) return; | ||
| if (_isEnabled) return; | ||
| _isEnabled = true; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
The same issue existed with the previous iteration on the intrumentation
Ah, simpler (better?) times... |
@opentelemetry/instrumentation-fsto orchestrion #20750This PR doesn't actually use orchestrion.
Becuase
fsin a Node built-in, it is CJS and can therfore be monkey patched like it's 2005.