powertools-lambda-dotnet icon indicating copy to clipboard operation
powertools-lambda-dotnet copied to clipboard

Feature request: Support using with Amazon.Lambda.AspNetCoreServer.Hosting

Open blytheaw opened this issue 1 year ago • 5 comments

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

blytheaw avatar Jul 24 '23 15:07 blytheaw