-
Notifications
You must be signed in to change notification settings - Fork 490
Closed
Closed
Copy link
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.module/aspnetcore-supportneeds-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.
Description
Describe the feature
Enhance the Lambda to AspNetCore handoff to include either (or both) the AwsRequestId
from the ILambdaContext
and the TraceId
from the LambdaContext
.
Use Case
This will help log correlation with things like AWS X-Ray, or other AWS Logs that are capturing the RequestId.
Proposed Solution
- Enhance
Amazon.Lambda.AspNetCoreServer.Internal.InvokeFeatures
to implementMicrosoft.AspNetCore.Http.Features.IHttpRequestIdentifierFeature
. - Enhance the various implementations of
MarshallRequest
to setup theIHttpRequestIdentifierFeature
, specifying using theILambdaContext.AwsRequestId
.
Other Information
See linked discussion for the path I took to get here. I'm not certain which makes more sense to use, the AwsRequestId or the TraceId. May depend on if you are using AWS X-Ray. Perhaps configurable?
This may be considered a breaking change, as it will no longer use the dotnet-generated RequestId. However, I feel using the AwsRequestId is more correct.
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS .NET SDK and/or Package version used
Amazon.Lambda.AspNetCoreServer.Hosting 1.0.0
Targeted .NET Platform
.NET Core 3.1, .NET 6
Operating System and version
Windows 10, OSX Mojave, Ubuntu, AmazonLinux
Metadata
Metadata
Assignees
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.module/aspnetcore-supportneeds-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.