Skip to content
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

chore(metrics): Fix low hanging fruit for v2 #800

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apidocs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"dest": "api",
"properties": {
"TargetFramework": "net6.0"
"TargetFramework": "net8.0"
},
"disableGitFeatures": false,
"disableDefaultFilter": false
Expand Down
6 changes: 3 additions & 3 deletions docs/core/metrics-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Powertools for AWS Lambda (.NET) are available as NuGet packages. You can instal

* [AWS.Lambda.Powertools.Metrics](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Metrics):

`dotnet nuget add AWS.Lambda.Powertools.Metrics`
`dotnet add package AWS.Lambda.Powertools.Metrics`

## Terminologies

Expand Down Expand Up @@ -608,7 +608,7 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use **`PushSing
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
{
Metrics.PushSingleMetric(
metricName: "ColdStart",
name: "ColdStart",
value: 1,
unit: MetricUnit.Count,
nameSpace: "ExampleApplication",
Expand All @@ -632,7 +632,7 @@ By default it will skip all previously defined dimensions including default dime
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
{
Metrics.PushSingleMetric(
metricName: "ColdStart",
name: "ColdStart",
value: 1,
unit: MetricUnit.Count,
nameSpace: "ExampleApplication",
Expand Down
2 changes: 1 addition & 1 deletion docs/core/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Powertools for AWS Lambda (.NET) are available as NuGet packages. You can instal

* [AWS.Lambda.Powertools.Metrics](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Metrics):

`dotnet nuget add AWS.Lambda.Powertools.Metrics`
`dotnet add package AWS.Lambda.Powertools.Metrics -v 1.7.1`

## Terminologies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class PowertoolsConfigurations : IPowertoolsConfigurations
/// <summary>
/// The maximum dimensions
/// </summary>
public const int MaxDimensions = 9;
public const int MaxDimensions = 29;

/// <summary>
/// The maximum metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ internal void AddDimension(DimensionSet dimension)
else
{
throw new ArgumentOutOfRangeException(nameof(Dimensions),
"Cannot add more than 9 dimensions at the same time.");
$"Cannot add more than {PowertoolsConfigurations.MaxDimensions} dimensions at the same time.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void WhenMaxDataPointsAreAddedToTheSameMetric_FlushAutomatically()
public void WhenMoreThan9DimensionsAdded_ThrowArgumentOutOfRangeException()
{
// Act
var act = () => { _handler.MaxDimensions(9); };
var act = () => { _handler.MaxDimensions(29); };

// Assert
Assert.Throws<ArgumentOutOfRangeException>(act);
Expand Down
Loading