Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

1.17 #678

Unanswered
hjgraca asked this question in General
1.17 #678
Nov 12, 2024 · 0 comments
Discussion options

Summary

AWS Lambda Powertools for .NET - Tracing 1.6.0

🐛 Bug Fixes

  • Fixed a NotSupportedException that occurred when using the Tracing utility in native AOT mode with async methods that don't return a value (Task)
  • Special thanks to @matthewwilson for reporting this issue! ⭐

📦 Package Information

  • Version: 1.6.0
  • Package: AWS.Lambda.Powertools.Tracing

Native AOT Support

Important

To allow Tracing to work with your types in native AOT mode, you must add **WithTracing()** to your source generator configuration. This works with either:

  • The default SourceGeneratorLambdaJsonSerializer
  • The Powertools Logging utility source generator PowertoolsSourceGeneratorSerializer

Tip

For detailed implementation guidelines, please refer to our AOT support documentation.

Implementation Examples

Using Default Source Generator

using AWS.Lambda.Powertools.Tracing;
using AWS.Lambda.Powertools.Tracing.Serializers;
private static async Task Main()
{
 Func<string, ILambdaContext, string> handler = FunctionHandler;
 await LambdaBootstrapBuilder.Create(handler, new SourceGeneratorLambdaJsonSerializer<LambdaFunctionJsonSerializerContext>()
 .WithTracing())
 .Build()
 .RunAsync();
}

Using Powertools Logging Source Generator

using AWS.Lambda.Powertools.Logging;
using AWS.Lambda.Powertools.Logging.Serializers;
using AWS.Lambda.Powertools.Tracing;
using AWS.Lambda.Powertools.Tracing.Serializers;
private static async Task Main()
{
 Func<string, ILambdaContext, string> handler = FunctionHandler;
 await LambdaBootstrapBuilder.Create(handler, 
 new PowertoolsSourceGeneratorSerializer<LambdaFunctionJsonSerializerContext>()
 .WithTracing())
 .Build()
 .RunAsync();
}

Changes

📜 Documentation updates

🔧 Maintenance

This release was made possible by the following contributors:

@hjgraca


This discussion was created from the release 1.17.
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /