Skip to content

Commit 56d5583

Browse files
authored
Merge pull request #225 from srcsakthivel/develop
chore(docs) - Metrics doc updates
2 parents 865979a + c7cc038 commit 56d5583

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/core/metrics.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Setting | Description | Environment variable | Constructor parameter
6969
using AWS.Lambda.Powertools.Metrics;
7070

7171
public class Function {
72-
Metrics(Namespace = "MyCompanyEcommerce", Service = "ShoppingCartService", CaptureColdStart = true, RaiseOnEmptyMetrics = true)]
72+
[Metrics(Namespace = "MyCompanyEcommerce", Service = "ShoppingCartService", CaptureColdStart = true, RaiseOnEmptyMetrics = true)]
7373
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
7474
{
7575
...
@@ -98,7 +98,7 @@ You can create metrics using **`AddMetric`**, and you can create dimensions for
9898
[Metrics(Namespace = "ExampleApplication", Service = "Booking")]
9999
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
100100
{
101-
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT);
101+
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count);
102102
}
103103
}
104104
```
@@ -113,7 +113,7 @@ You can create metrics using **`AddMetric`**, and you can create dimensions for
113113
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
114114
{
115115
Metrics.AddDimension("Environment","Prod");
116-
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT);
116+
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count);
117117
}
118118
}
119119
```
@@ -149,7 +149,7 @@ You can use **`SetDefaultDimensions`** method to persist dimensions across Lambd
149149
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
150150
{
151151
Metrics.SetDefaultDimensions(_defaultDimensions);
152-
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT);
152+
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count);
153153
}
154154
}
155155
```
@@ -170,7 +170,7 @@ During metrics validation, if no metrics are provided then a warning will be log
170170
[Metrics(Namespace = "ExampleApplication", Service = "Booking")]
171171
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
172172
{
173-
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT);
173+
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count);
174174
}
175175
}
176176
```
@@ -271,7 +271,7 @@ You can add high-cardinality data as part of your Metrics log with `AddMetadata`
271271
[Metrics(Namespace = ExampleApplication, Service = "Booking")]
272272
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
273273
{
274-
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT);
274+
Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count);
275275
Metrics.AddMetadata("BookingId", "683EEB2D-B2F3-4075-96EE-788E6E2EED45");
276276
...
277277
```
@@ -327,7 +327,7 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use **`PushSing
327327
Metrics.PushSingleMetric(
328328
metricName: "ColdStart",
329329
value: 1,
330-
unit: MetricUnit.COUNT,
330+
unit: MetricUnit.Count,
331331
nameSpace: "ExampleApplication",
332332
service: "Booking",
333333
defaultDimensions: new Dictionary<string, string>

0 commit comments

Comments
 (0)