Support extending Amazon.Lambda.AspNetCoreServer.Hosting handler #1551
Labels
feature-request
A feature should be added or improved.
module/aspnetcore-support
p1
This is a high priority issue
queued
Describe the feature
Provide some way to annotate or wrap the abstracted handler provided by Amazon.Lambda.AspNetCoreServer.Hosting so that third party tooling that requires interaction with the handler can be used.
Use Case
Many observability and utility tools for .NET (OpenTelemetry and AWS Lambda Powertools to name the most prominent) require either directly wrapping the Lambda handler or adding annotations to it.
Proposed Solution
Some kind of override or extension method that would allow for slapping annotations or boilerplate around the handler without sacrificing the convenience of Amazon.Lambda.AspNetCoreServer.Hosting. Maybe a delegate in the registration method (AddAWSLambdaHosting) to allow adding some arbitrary code executed before the handler.
Other Information
Amazon.Lambda.AspNetCoreServer.Hosting is an amazing package and solution that lowers the barrier to entry for moving non-serverless .NET APIs to AWS Lambda with very little overhead. I'm excited about this because it can help increase adoption of serverless in my teams and be less intimidating.
However, we need to be able to use observability tooling to go to production, and this is the only real show-stopper for us.
I'm not totally against using the less abstracted method with LambdaEntryPoint / LocalEntryPoint but we've already consolidated Program.cs and Startup.cs using the minimal API startup model and we would have to undo that in all of our services to revert back to this pattern.
Acknowledgements
AWS .NET SDK and/or Package version used
Amazon.Lambda.AspNetCoreServer.Hosting
Targeted .NET Platform
.NET 6
Operating System and version
Any
The text was updated successfully, but these errors were encountered: