From 3cfed86d7be9140ef82ae0a699be175d72394457 Mon Sep 17 00:00:00 2001
From: Henrique Graca <999396+hjgraca@users.noreply.github.com>
Date: Mon, 25 Sep 2023 20:28:29 +0100
Subject: [PATCH] chore: Update Powertools dotnet6 template v1.7.0 (#450)
* Update Powertools dotnet6 template
Update Powertools dotnet6 template with new versions from release 1.7.0
* AWSXRayRecorder needs to be updated as well
* reverting non powertools nuget updates
* remove xrayrecorder sdk dependency
* Update Function.cs Tracing example
* Update nuget versions
---------
Co-authored-by: Daniel Mil <84205762+mildaniel@users.noreply.github.com>
---
.../src/HelloWorld/Function.cs | 3 +--
.../src/HelloWorld/HelloWorld.csproj | 7 +++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/Function.cs b/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/Function.cs
index 084e37b3f..058c18ed5 100644
--- a/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/Function.cs
+++ b/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/Function.cs
@@ -7,7 +7,6 @@
using Amazon.Lambda.Core;
using Amazon.Lambda.APIGatewayEvents;
{%- if cookiecutter["Powertools for AWS Lambda (.NET) Tracing"] == "enabled"%}
-using Amazon.XRay.Recorder.Handlers.AwsSdk;
using AWS.Lambda.Powertools.Tracing;
{%- endif %}
{%- if cookiecutter["Powertools for AWS Lambda (.NET) Metrics"] == "enabled"%}
@@ -29,7 +28,7 @@ public class Function
{%- if cookiecutter["Powertools for AWS Lambda (.NET) Tracing"] == "enabled"%}
public Function()
{
- AWSSDKHandler.RegisterXRayForAllServices();
+ Tracing.RegisterForAllServices();
}
{%- endif %}
diff --git a/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj b/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj
index 6f9d45081..a5d78e7e9 100644
--- a/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj
+++ b/dotnet6/hello-pt/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj
@@ -11,14 +11,13 @@
{%- if cookiecutter["Powertools for AWS Lambda (.NET) Tracing"] == "enabled"%}
-
-
+
{%- endif %}
{%- if cookiecutter["Powertools for AWS Lambda (.NET) Metrics"] == "enabled"%}
-
+
{%- endif %}
{%- if cookiecutter["Powertools for AWS Lambda (.NET) Logging"] == "enabled"%}
-
+
{%- endif %}