Skip to content

[Serverless] Add remaining event metadata attributes#2740

Merged
sharvath-newrelic merged 1 commit intoserverless-modefrom
add-event-metadata-attributes
Feb 20, 2026
Merged

[Serverless] Add remaining event metadata attributes#2740
sharvath-newrelic merged 1 commit intoserverless-modefrom
add-event-metadata-attributes

Conversation

@sharvath-newrelic
Copy link
Copy Markdown
Contributor

@sharvath-newrelic sharvath-newrelic commented Feb 6, 2026

Overview

This PR enhances AWS Lambda event metadata extraction by adding comprehensive attribute collection for all supported Lambda event types based on the details outlined in the Lambda spec. Several new attributes constants have been added, along with a map-based dispatcher pattern for cleaner event type handling. I've also broken up the extraction logic monolith into dedicated methods per event type.

Related Github Issue

Resolves #2733

Testing

Several unit tests have been added to provide coverage for all supported event types. Performance tests have been included in the java-agent/sample-apps repo to expand e2e testing.

EVENT_EXTRACTORS.put(APIGatewayProxyRequestEvent.class, (event, txn) -> extractAPIGatewayProxyMetadata((APIGatewayProxyRequestEvent) event, txn));
EVENT_EXTRACTORS.put(APIGatewayV2HTTPEvent.class, (event, txn) -> extractAPIGatewayV2HTTPMetadata((APIGatewayV2HTTPEvent) event, txn));
EVENT_EXTRACTORS.put(CloudFrontEvent.class, (event, txn) -> extractCloudFrontMetadata((CloudFrontEvent) event, txn));
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This approach might be overkill, but perhaps preferable to a chunky if/else statement.

@sharvath-newrelic sharvath-newrelic marked this pull request as ready for review February 18, 2026 19:06
@sharvath-newrelic sharvath-newrelic merged commit ae29420 into serverless-mode Feb 20, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Triage to Code Complete/Done in Java Engineering Board Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants