Skip to content

Commit a61f747

Browse files
authored
Merge pull request #800 from hjgraca/fix/low-hanging-fruit-metrics-v2
chore(metrics): Fix low hanging fruit for v2
2 parents 4858539 + 8b6b839 commit a61f747

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

apidocs/docfx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"dest": "api",
1111
"properties": {
12-
"TargetFramework": "net6.0"
12+
"TargetFramework": "net8.0"
1313
},
1414
"disableGitFeatures": false,
1515
"disableDefaultFilter": false

docs/core/metrics-v2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Powertools for AWS Lambda (.NET) are available as NuGet packages. You can instal
3535

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

38-
`dotnet nuget add AWS.Lambda.Powertools.Metrics`
38+
`dotnet add package AWS.Lambda.Powertools.Metrics`
3939

4040
## Terminologies
4141

@@ -608,7 +608,7 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use **`PushSing
608608
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
609609
{
610610
Metrics.PushSingleMetric(
611-
metricName: "ColdStart",
611+
name: "ColdStart",
612612
value: 1,
613613
unit: MetricUnit.Count,
614614
nameSpace: "ExampleApplication",
@@ -632,7 +632,7 @@ By default it will skip all previously defined dimensions including default dime
632632
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
633633
{
634634
Metrics.PushSingleMetric(
635-
metricName: "ColdStart",
635+
name: "ColdStart",
636636
value: 1,
637637
unit: MetricUnit.Count,
638638
nameSpace: "ExampleApplication",

docs/core/metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Powertools for AWS Lambda (.NET) are available as NuGet packages. You can instal
2828

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

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

3333
## Terminologies
3434

libraries/src/AWS.Lambda.Powertools.Common/Core/PowertoolsConfigurations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class PowertoolsConfigurations : IPowertoolsConfigurations
2727
/// <summary>
2828
/// The maximum dimensions
2929
/// </summary>
30-
public const int MaxDimensions = 9;
30+
public const int MaxDimensions = 29;
3131

3232
/// <summary>
3333
/// The maximum metrics

libraries/src/AWS.Lambda.Powertools.Metrics/Model/MetricDirective.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ internal void AddDimension(DimensionSet dimension)
204204
else
205205
{
206206
throw new ArgumentOutOfRangeException(nameof(Dimensions),
207-
"Cannot add more than 9 dimensions at the same time.");
207+
$"Cannot add more than {PowertoolsConfigurations.MaxDimensions} dimensions at the same time.");
208208
}
209209
}
210210

libraries/tests/AWS.Lambda.Powertools.Metrics.Tests/EMFValidationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void WhenMaxDataPointsAreAddedToTheSameMetric_FlushAutomatically()
113113
public void WhenMoreThan9DimensionsAdded_ThrowArgumentOutOfRangeException()
114114
{
115115
// Act
116-
var act = () => { _handler.MaxDimensions(9); };
116+
var act = () => { _handler.MaxDimensions(29); };
117117

118118
// Assert
119119
Assert.Throws<ArgumentOutOfRangeException>(act);

0 commit comments

Comments
 (0)