generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 33
chore: remove dotnet6 from docs and add migration guides for v2 and v3 #1021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,22 +16,11 @@ These metrics can be visualized through [Amazon CloudWatch Console](https://aws. | |
| * Ahead-of-Time compilation to native code support [AOT](https://docs.aws.amazon.com/lambda/latest/dg/dotnet-native-aot.html) from version 1.7.0 | ||
| * Support for AspNetCore middleware and filters to capture metrics for HTTP requests | ||
|
|
||
| ## Breaking changes from V1 | ||
| !!! warning "Migrating to v3" | ||
|
|
||
| !!! info | ||
|
|
||
| Loooking for v1 specific documentation please go to [Metrics v1](/lambda/dotnet/core/metrics-v1) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved to dedicated guide |
||
|
|
||
| * **`Dimensions`** outputs as an array of arrays instead of an array of objects. Example: `Dimensions: [["service", "Environment"]]` instead of `Dimensions: ["service", "Environment"]` | ||
| * **`FunctionName`** is not added as default dimension and only to cold start metric. | ||
| * **`Default Dimensions`** can now be included in Cold Start metrics, this is a potential breaking change if you were relying on the absence of default dimensions in Cold Start metrics when searching. | ||
| If you're upgrading to v3, please review the [Migration Guide v3](../migration-guide-v3.md) for important breaking changes including .NET 8 requirement and AWS SDK v4 migration. | ||
|
|
||
| <br /> | ||
|
|
||
| <figure> | ||
| <img src="../../media/metrics_utility_showcase.png" loading="lazy" alt="Screenshot of the Amazon CloudWatch Console showing an example of business metrics in the Metrics Explorer" /> | ||
| <figcaption>Metrics showcase - Metrics Explorer</figcaption> | ||
| </figure> | ||
| If you're upgrading to v2, please review the [Migration Guide v2](../migration-guide-v2.md/#metrics). | ||
|
|
||
| ## Installation | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| --- | ||
| title: Migration Guide v2 | ||
| slug: migration-guide-v2 | ||
| description: Migration guide to upgrade to v2 | ||
| --- | ||
|
|
||
| # Migration Guide to v2 | ||
|
|
||
| This guide will help you migrate to v2 | ||
|
|
||
| ## Logging | ||
|
|
||
| ### Breaking changes from v1 (dependency updates) | ||
|
|
||
| !!! info | ||
|
|
||
| Looking for V1 specific documentation please go to [Logging v1](/lambda/dotnet/core/logging-v1) | ||
|
|
||
| | Change | Before (v1.x) | After (v2.0) | Migration Action | | ||
| |--------|---------------|--------------|-----------------| | ||
| | Amazon.Lambda.Core | 2.2.0|2.5.0 | dotnet add package Amazon.Lambda.Core | | ||
| | Amazon.Lambda.Serialization.SystemTextJson | 2.4.3 | 2.4.4 | dotnet add package Amazon.Lambda.Serialization.SystemTextJson | | ||
| | Microsoft.Extensions.DependencyInjection | 8.0.0 | 8.0.1 | dotnet add package Microsoft.Extensions.DependencyInjection | | ||
|
|
||
| #### Extra keys - Breaking change | ||
|
|
||
| In v1.x, the extra keys were added to the log entry as a dictionary. In v2.x, the extra keys are added to the log entry as | ||
| a JSON object. | ||
|
|
||
| There is no longer a method that accepts extra keys as first argument. | ||
|
|
||
| === "Before (v1)" | ||
|
|
||
| ```csharp | ||
| public class User | ||
| { | ||
| public string Name { get; set; } | ||
| public int Age { get; set; } | ||
| } | ||
|
|
||
| Logger.LogInformation<User>(user, "{Name} is {Age} years old", | ||
| new object[]{user.Name, user.Age}); | ||
|
|
||
| var scopeKeys = new | ||
| { | ||
| PropOne = "Value 1", | ||
| PropTwo = "Value 2" | ||
| }; | ||
| Logger.LogInformation(scopeKeys, "message"); | ||
|
|
||
| ``` | ||
|
|
||
| === "After (v2)" | ||
|
|
||
| ```csharp | ||
| public class User | ||
| { | ||
| public string Name { get; set; } | ||
| public int Age { get; set; } | ||
|
|
||
| public override string ToString() | ||
| { | ||
| return $"{Name} is {Age} years old"; | ||
| } | ||
| } | ||
|
|
||
| // It uses the ToString() method of the object to log the message | ||
| // the extra keys are added because of the {@} in the message template | ||
| Logger.LogInformation("{@user}", user); | ||
|
|
||
| var scopeKeys = new | ||
| { | ||
| PropOne = "Value 1", | ||
| PropTwo = "Value 2" | ||
| }; | ||
|
|
||
| // there is no longer a method that accepts extra keys as first argument. | ||
| Logger.LogInformation("{@keys}", scopeKeys); | ||
| ``` | ||
|
|
||
| This change was made to improve the performance of the logger and to make it easier to work with the extra keys. | ||
|
|
||
| ## Metrics | ||
|
|
||
| ### Breaking changes from V1 | ||
|
|
||
| !!! info | ||
|
|
||
| Loooking for v1 specific documentation please go to [Metrics v1](/lambda/dotnet/core/metrics-v1) | ||
|
|
||
| * **`Dimensions`** outputs as an array of arrays instead of an array of objects. Example: `Dimensions: [["service", "Environment"]]` instead of `Dimensions: ["service", "Environment"]` | ||
| * **`FunctionName`** is not added as default dimension and only to cold start metric. | ||
| * **`Default Dimensions`** can now be included in Cold Start metrics, this is a potential breaking change if you were relying on the absence of default dimensions in Cold Start metrics when searching. | ||
|
|
||
| <br /> | ||
|
|
||
| <figure> | ||
| <img src="../../media/metrics_utility_showcase.png" loading="lazy" alt="Screenshot of the Amazon CloudWatch Console showing an example of business metrics in the Metrics Explorer" /> | ||
| <figcaption>Metrics showcase - Metrics Explorer</figcaption> | ||
| </figure> | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to dedicated page migration-guide-v2