Skip to content

fix: remove debug logs and use the diag logger for init timings #1861

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxday
Copy link
Member

@maxday maxday commented Jun 10, 2025

As discussed during the SIG meeting, let's remove the Registering OpenTelemetry log as this is showing in plain text (not JSON formatted)
see picture below:
Screenshot 2025-06-10 at 11 46 19 PM

The init duration information can definitely be useful so I propose to use the diag logger and set the level to DEBUG. This way a customer using INFO log, won't see any plain text logs.

@maxday maxday requested a review from a team as a code owner June 10, 2025 23:23
@@ -610,7 +610,9 @@ export async function init() {
initialized = true;
}

console.log('Registering OpenTelemetry');
export function logDebug(message: string, ...args: unknown[]) {
diag.debug(message, ...args);
Copy link
Member

Choose a reason for hiding this comment

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

Any reason this needs to be a separate function rather than calling debug directly from the callers?

Copy link
Contributor

Choose a reason for hiding this comment

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

When everything is bundled, any OTEL module (including diag) is not directly available to the outside of wrapper. It can be solved by configuring webpack to bundle diag out individually, but it will just complicate the things. So, I think, it is better to have init.mjs handling the things over wrapper instead of having directt dependency.

Copy link
Member Author

Choose a reason for hiding this comment

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

@serkan-ozal exactly!

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.

3 participants