I have a c# lambda project and would like to now set up the project for AWS XRay.
My project contains a startup class and within ConfigureServices, Ive added
private static IServiceCollection ConfigureServices(IConfigurationRoot root)
{
AWSXRayRecorder.InitializeInstance(root);
....
}
Unfortunately, since this is a lambda project, there is no
Configure(IApplicationBuilder app, IWebHostEnvironment env)
What other code changes to Startup.cs need to be made in order to get the XRay working?
If you're missing
Configuremethod inStartupfile, you may try configureapp.UseXRay()inCreateHostBuilder()inProgramfile.Please note, the order of
AWSXRayMiddlewarein the HTTP request pipeline matters, so you may need to make sure you've configured the pipeline properly.