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

Serialisation exception for ScheduledEvent #4645

Closed
acm19 opened this issue Nov 15, 2021 · 2 comments · Fixed by #4724
Closed

Serialisation exception for ScheduledEvent #4645

acm19 opened this issue Nov 15, 2021 · 2 comments · Fixed by #4724
Labels
bug Something isn't working

Comments

@acm19
Copy link
Contributor

acm19 commented Nov 15, 2021

Describe the bug
When instrumenting a Lambda triggered by ScheduledEvent a parsing exception is produced:

at io.opentelemetry.instrumentation.awslambda.v1_0.TracingRequestHandler.handleRequest(TracingRequestHandler.java:89)
Caused by: java.lang.IllegalArgumentException: Unrecognized field "version" (class com.amazonaws.services.lambda.runtime.events.ScheduledEvent), not marked as ignorable (8 known properties: "detail", "region", "resources", "detailType", "account", "source", "time", "id"])

Steps to reproduce
Create a lambda triggered by a ScheduledEvent and instrument it using OpenTelemetry following this tutorial: https://aws-otel.github.io/docs/getting-started/lambda/lambda-java.

What did you expect to see?
I expect no exception.

What did you see instead?
The lambda failed with an exception.

What version are you using?
v1.7.0

Environment
Java 11 Corretto running in AWS Lambda.

Additional context
I think a good way to fix the problem would be to ignore unknown properties by this object mapper:

. I'm happy to create a PR if that would speed up having it fixed.

@acm19 acm19 added the bug Something isn't working label Nov 15, 2021
@laurit
Copy link
Contributor

laurit commented Nov 18, 2021

@acm19 a pr would be appreciated.

@acm19
Copy link
Contributor Author

acm19 commented Nov 26, 2021

@laurit #4724

trask pushed a commit that referenced this issue Jan 14, 2022
Adds `FAIL_ON_UNKNOWN_PROPERTIES` to the paramter parser on the lambda
as events coming from AWS have more fields than those represented in the
libraries provided by AWS. Adds a custom `JodaModule` to the same
parser to support `ScheduledEvent` which for now uses Joda Time. At the
same time avoid the real Joda Module to not have extra dependencies.

Resolves: #4645
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this issue May 23, 2022
…4724)

Adds `FAIL_ON_UNKNOWN_PROPERTIES` to the paramter parser on the lambda
as events coming from AWS have more fields than those represented in the
libraries provided by AWS. Adds a custom `JodaModule` to the same
parser to support `ScheduledEvent` which for now uses Joda Time. At the
same time avoid the real Joda Module to not have extra dependencies.

Resolves: open-telemetry#4645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants