Skip to content

Commit 0d0e5c9

Browse files
authored
Merge pull request #624 from aws-powertools/develop
chore: sync main from develop for release 1.12
2 parents eb89437 + 2ed95ef commit 0d0e5c9

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

examples/AOT/src/AOT/AOT.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
<PackageReference Include="Amazon.Lambda.Core" Version="2.2.0"/>
2222
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.1"/>
2323
<PackageReference Include="AWS.Lambda.Powertools.Metrics" Version="1.7.1" />
24+
<PackageReference Include="AWS.Lambda.Powertools.Tracing" Version="1.5.0" />
2425
</ItemGroup>
2526
</Project>

examples/AOT/src/AOT/Function.cs

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Amazon.Lambda.Serialization.SystemTextJson;
44
using System.Text.Json.Serialization;
55
using AWS.Lambda.Powertools.Metrics;
6+
using AWS.Lambda.Powertools.Tracing;
67

78
namespace AOT;
89

@@ -45,6 +46,7 @@ await LambdaBootstrapBuilder.Create(handler,
4546

4647
// You can optionally capture cold start metrics by setting CaptureColdStart parameter to true.
4748
[Metrics(Namespace = "ns", Service = "svc", CaptureColdStart = true)]
49+
[Tracing(CaptureMode = TracingCaptureMode.ResponseAndError)]
4850
public static string FunctionHandler(string input, ILambdaContext context)
4951
{
5052
// You can create metrics using AddMetric
@@ -53,12 +55,15 @@ public static string FunctionHandler(string input, ILambdaContext context)
5355
return ToUpper(input);
5456
}
5557

58+
[Tracing(SegmentName = "ToUpper Call")]
5659
private static string ToUpper(string input)
5760
{
5861
Metrics.AddMetric("ToUpper invocation", 1, MetricUnit.Count);
5962

6063
var upper = input.ToUpper();
6164

65+
Tracing.AddAnnotation("Upper text", upper);
66+
6267
// You can add high-cardinality data as part of your Metrics log with AddMetadata method.
6368
// This is useful when you want to search highly contextual information along with your metrics in your logs.
6469
Metrics.AddMetadata("Input Uppercase", upper);

examples/ServerlessApi/src/LambdaPowertoolsAPI/LambdaPowertoolsAPI.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="9.0.0" />
1616
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="1.5.1" />
1717
<PackageReference Include="AWS.Lambda.Powertools.Metrics" Version="1.7.1" />
18-
<PackageReference Include="AWS.Lambda.Powertools.Tracing" Version="1.4.2" />
18+
<PackageReference Include="AWS.Lambda.Powertools.Tracing" Version="1.5.0" />
1919
</ItemGroup>
2020
</Project>

examples/Tracing/src/HelloWorld/HelloWorld.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.7.0" />
1010
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.1" />
1111
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="1.5.1" />
12-
<PackageReference Include="AWS.Lambda.Powertools.Tracing" Version="1.4.2" />
12+
<PackageReference Include="AWS.Lambda.Powertools.Tracing" Version="1.5.0" />
1313
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.18" />
1414
</ItemGroup>
1515
</Project>

0 commit comments

Comments
 (0)