Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR adds a startup hook to optionally disable OpenTelemetry (OTel) tracing/metrics/diagnostic logging via an environment variable, to reduce noisy console output when an OTel collector isn’t available.
Changes:
- Added
disableOtelIfRequested()helper to disable tracing, metrics, and OTel diag logging whenOTEL_DISABLEDis set. - Invoked the helper from the application entrypoint at startup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/lib/otel.ts | Introduces env-controlled OTel disablement helper (trace/metrics disable + diag logger suppression). |
| src/index.ts | Calls the helper during startup to attempt to disable OTel before server initialization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
phvalguima
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
When the otel collector is off the output of it goes into the console out. This makes harder to debug other parts as it is very noisy
Solution
This pull request introduces a mechanism to conditionally disable OpenTelemetry (OTel) instrumentation based on an environment variable. The main change is the addition of a utility function that disables OTel features if requested, and its invocation at application startup.
OpenTelemetry disablement:
disableOtelIfRequestedinsrc/lib/otel.tsthat disables tracing, metrics, and diagnostic logging when theOTEL_DISABLEDenvironment variable is set to"true"or"1".disableOtelIfRequestedat the top ofsrc/index.tsto ensure OTel is disabled before the server starts, if requested.