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

Token provider in EC2 metadata does not respect the logging decision #5116

Closed
matej-g opened this issue Dec 19, 2023 · 3 comments
Closed

Token provider in EC2 metadata does not respect the logging decision #5116

matej-g opened this issue Dec 19, 2023 · 3 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue

Comments

@matej-g
Copy link

matej-g commented Dec 19, 2023

Describe the bug

In token provider which is part of the EC2 metadata service, the logging decision is not respected in this part of the code:

t.client.Config.Logger.Log(fmt.Sprintf("WARN: failed to get session token, falling back to IMDSv1: %v", requestFailureError))

Even though the SDK is configured with LogOff log level by default, the line still gets printed to the stdout. Since we're using this library in the upstream project (see related open-telemetry/opentelemetry-collector-contrib#22807 (comment)), we wish not to log messages from the SDK but rather to handle any errors returned by the SDK.

Expected Behavior

No to see any SDK logs

Current Behavior

SDK logs a warning message to stdout

Reproduction Steps

The issues should be self explanatory without reproduction, but simplest way to reproduce would be to follow scenario described in open-telemetry/opentelemetry-collector-contrib#22807 (comment)

Possible Solution

No response

Additional Information/Context

No response

SDK version used

v1.49.1

Environment details (Version of Go (go version)? OS name and version, etc.)

1.21.5

@matej-g matej-g added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 19, 2023
@RanVaknin RanVaknin self-assigned this Dec 19, 2023
@RanVaknin RanVaknin removed the needs-triage This issue or PR still needs to be triaged. label Jan 4, 2024
@RanVaknin
Copy link
Contributor

Hey @matej-g ,

Apologies for the late response. I agree with you that logOff shouldn't log anything else. This took a bit to root cause and seems like it was a design choice. I have patched this particular warning, but there might be other warnings surfaced in the SDK that we do not have visibility to.

Thanks,
Ran~

@RanVaknin RanVaknin added pending-release This issue will be fixed by an approved PR that hasn't been released yet. p3 This is a minor priority issue labels Jan 4, 2024
@matej-g
Copy link
Author

matej-g commented Jan 5, 2024

Thanks for the help here @RanVaknin, appreciate it!

@lucix-aws lucix-aws removed the pending-release This issue will be fixed by an approved PR that hasn't been released yet. label Feb 5, 2024
Copy link

github-actions bot commented Feb 5, 2024

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

3 participants