powertools-lambda-dotnet
powertools-lambda-dotnet copied to clipboard
Feature request: Support using with Amazon.Lambda.AspNetCoreServer.Hosting
Use case
The minimal API model using Amazon.Lambda.AspNetCoreServer.Hosting is a great way to migrate an existing ASP .NET API to AWS Lambda. However, if one requires better observability, there are not a lot of great options. It would be great if I could use Powertools for logging and tracing while still using this simple hosting model.
If this is already possible, I was not able to find it in the docs. Please advise!
Solution/User Experience
A way to initialize the tracer, logger, and metrics in the standard startup / dependency injection model of .NET would be ideal, rather than having to annotate the handler method specifically. Since the handler itself is not exposed when using the minimal API hosting model, I can't find a way to initialize the tracer and logger.
Alternative solutions
No response
Acknowledgment
- [X] This feature request meets Powertools for AWS Lambda (.NET) Tenets
- [ ] Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and TypeScript