-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
internalMaintenance changesMaintenance changes
Description
Summary
When creating an trace inside a method using Tracing's WithSubsegment
method, the action requires no additional imports, just the reference to AWS.Lambda.Powertools.Tracing
.
using AWS.Lambda.Powertools.Tracing;
...
Tracing.WithSubsegment("SendGrid", async s =>
{
var response = await client.SendEmailAsync(msg);
Logger.LogInformation(response.StatusCode);
if (response.StatusCode == HttpStatusCode.Accepted)
{
nextExam.NotificationSent = true;
}
});
however, if this call is refactored to use a local function for example, all of a sudden you need to reference Amazon.XRay.Recorder.Core.Internal.Entities
because of the Subsegment
type:
using AWS.Lambda.Powertools.Tracing;
using Amazon.XRay.Recorder.Core.Internal.Entities;
...
async void Subsegment(Subsegment subsegment)
{
var response = await client.SendEmailAsync(msg);
Logger.LogInformation(response.StatusCode);
if (response.StatusCode == HttpStatusCode.Accepted)
{
nextExam.NotificationSent = true;
}
}
Tracing.WithSubsegment("SendGrid", Subsegment);
This causes some confusion since the X-Ray libraries are included with PT.
Ideally, we would want to hide this implementation also and bring Amazon.XRay.Recorder.Core.Internal.Entities
under Powertools.
Why is this needed?
It exposes the internals of Tracing utility.
Which area does this relate to?
Tracing
Solution
No response
Acknowledgment
- This request meets Powertools for AWS Lambda (.NET) Tenets
Metadata
Metadata
Assignees
Labels
internalMaintenance changesMaintenance changes
Type
Projects
Status
🏗 In progress