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

AWS Lambda - NullPointerException in TracingSqsEventHandler #9708

Closed
tduncan opened this issue Oct 18, 2023 · 0 comments · Fixed by #9710
Closed

AWS Lambda - NullPointerException in TracingSqsEventHandler #9708

tduncan opened this issue Oct 18, 2023 · 0 comments · Fixed by #9710
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@tduncan
Copy link
Contributor

tduncan commented Oct 18, 2023

Describe the bug

TracingSqsEventHandler throws a NullPointerException when an AWS Lambda function extending from either TracingSqsEventHandler or TracingSqsEventWrapper is invoked with something other than an SQS event. This NullPointerException prevents the Lambda function from executing. See the stacktrace below (taken from CloudWatch logs).

{
  "errorMessage": "java.lang.NullPointerException",
  "errorType": "java.lang.NullPointerException",
  "stackTrace": [
    "io.opentelemetry.instrumentation.awslambdaevents.v2_2.internal.AwsLambdaSqsInstrumenterFactory.spanName(AwsLambdaSqsInstrumenterFactory.java:42)",
    "io.opentelemetry.instrumentation.api.instrumenter.Instrumenter.doStart(Instrumenter.java:165)",
    "io.opentelemetry.instrumentation.api.instrumenter.Instrumenter.start(Instrumenter.java:131)",
    "io.opentelemetry.instrumentation.awslambdaevents.v2_2.TracingSqsEventHandler.doHandleRequest(TracingSqsEventHandler.java:57)",
    "io.opentelemetry.instrumentation.awslambdaevents.v2_2.TracingSqsEventHandler.doHandleRequest(TracingSqsEventHandler.java:17)",
    "io.opentelemetry.instrumentation.awslambdacore.v1_0.TracingRequestHandler.handleRequest(TracingRequestHandler.java:79)"
  ]
}

Steps to reproduce

  1. Create a AWS Lambda request handler extending TracingSqsEventWrapper
  2. Deploy the Lambda function (include the OpenTelemetry libraries in the .zip)
  3. Invoke the Lambda function in someway other than an SQS message

Expected behavior

The AWS Lambda function to still be executed. Exceptions in the instrumentation layer shouldn't prevent AWS Lambda functions from receiving events.

Actual behavior

The NullPointerException stops the AWS Lambda function from executing.

Javaagent or library instrumentation version

1.31.0-alpha

Environment

JDK: Amazon Corretto 11
OS: Amazon Linux 2

Additional context

No response

@tduncan tduncan added bug Something isn't working needs triage New issue that requires triage labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant