Skip to content

Commit 98f1342

Browse files
committed
new fluent api
1 parent b27fdb9 commit 98f1342

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

examples/Tracing/src/HelloWorld/Function.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,10 @@ public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyReques
8787
greeting: "Hello Powertools for AWS Lambda (.NET)", ipAddress: location);
8888

8989
// Trace Fluent API
90-
Tracing.WithSubsegment("LoggingResponse",
91-
subsegment =>
92-
{
93-
subsegment.AddAnnotation("AccountId", apigwProxyEvent.RequestContext.AccountId);
94-
subsegment.AddMetadata("LookupRecord", lookupRecord);
95-
});
96-
90+
using var gatewaySegment = Tracing.BeginSubsegment("LoggingResponse");
91+
gatewaySegment.AddAnnotation("AccountId", apigwProxyEvent.RequestContext.AccountId);
92+
gatewaySegment.AddMetadata("LookupRecord", lookupRecord);
93+
9794
try
9895
{
9996
await SaveRecordInDynamo(lookupRecord);

0 commit comments

Comments
 (0)