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

fix(instrumentation-aws-lambda): soften "unable to init" message and demote to diag.debug #1836

Merged

Conversation

beggers
Copy link
Contributor

@beggers beggers commented Nov 29, 2023

Which problem is this PR solving?

When not in a Lambda, the AWS Lambda instrumentation spits out an error-level message saying it can't initialize. This pollutes logs for all Node applications using autoinstrumentation.

Short description of the changes

  • Switch to a debug-level message since this is an expected case.

@beggers beggers requested a review from a team November 29, 2023 17:16
Copy link

linux-foundation-easycla bot commented Nov 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@beggers beggers changed the title Bugfix/1774 initialization error Fix: Remove Lambda initialization error when not in a Lambda Nov 29, 2023
@beggers beggers changed the title Fix: Remove Lambda initialization error when not in a Lambda fix: Remove Lambda initialization error when not in a Lambda Nov 29, 2023
Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

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

LGTM.

It is reasonable to have any given instrumentation enabled, even if it ends up not being relevant for the app; and is commonly the case given the current advice to use auto-instrumentations-node.

If those envvars (defined at https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime) are not set, then the app isn't in a Lambda env. In that case, it is weird to log an error about it. I'd even consider softening the language of the debug message.

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Merging #1836 (2e94096) into main (1c2e8b2) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1836   +/-   ##
=======================================
  Coverage   96.06%   96.06%           
=======================================
  Files          14       14           
  Lines         914      914           
  Branches      199      199           
=======================================
  Hits          878      878           
  Misses         36       36           

@beggers
Copy link
Contributor Author

beggers commented Nov 30, 2023

Hey @trentm looks like CI is failing due to code coverage (0% of new lines are covered by tests, the horror). Is it cool to merge this as-is?

@trentm
Copy link
Contributor

trentm commented Nov 30, 2023

the horror

Heh.

@beggers I think it is good to go, yes. However, I'm a fairly new approver on this repo, so I was going to wait a little while to give others a chance to approve or not.

@carolabadeer You are the component owner, do you have an opinion on this PR? Thanks.

@trentm trentm merged commit fb80783 into open-telemetry:main Dec 1, 2023
@trentm trentm changed the title fix: Remove Lambda initialization error when not in a Lambda fix(instrumentation-lambda): soften "unable to init" message and demote to diag.debug Dec 1, 2023
@trentm trentm changed the title fix(instrumentation-lambda): soften "unable to init" message and demote to diag.debug fix(instrumentation-aws-lambda): soften "unable to init" message and demote to diag.debug Dec 1, 2023
@trentm trentm changed the title fix(instrumentation-aws-lambda): soften "unable to init" message and demote to diag.debug fix(instrumentation-aws-lambda): soften "unable to init" message and demote to diag.debug Dec 1, 2023
@dyladan dyladan mentioned this pull request Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to initialize instrumentation for lambda. Cannot identify lambda handler or task root.
2 participants