@@ -69,7 +69,7 @@ Setting | Description | Environment variable | Constructor parameter
69
69
using AWS.Lambda.Powertools.Metrics;
70
70
71
71
public class Function {
72
- Metrics(Namespace = "MyCompanyEcommerce", Service = "ShoppingCartService", CaptureColdStart = true, RaiseOnEmptyMetrics = true)]
72
+ [ Metrics(Namespace = "MyCompanyEcommerce", Service = "ShoppingCartService", CaptureColdStart = true, RaiseOnEmptyMetrics = true)]
73
73
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
74
74
{
75
75
...
@@ -98,7 +98,7 @@ You can create metrics using **`AddMetric`**, and you can create dimensions for
98
98
[Metrics(Namespace = "ExampleApplication", Service = "Booking")]
99
99
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
100
100
{
101
- Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT );
101
+ Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count );
102
102
}
103
103
}
104
104
```
@@ -113,7 +113,7 @@ You can create metrics using **`AddMetric`**, and you can create dimensions for
113
113
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
114
114
{
115
115
Metrics.AddDimension("Environment","Prod");
116
- Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT );
116
+ Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count );
117
117
}
118
118
}
119
119
```
@@ -149,7 +149,7 @@ You can use **`SetDefaultDimensions`** method to persist dimensions across Lambd
149
149
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
150
150
{
151
151
Metrics.SetDefaultDimensions(_defaultDimensions);
152
- Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT );
152
+ Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count );
153
153
}
154
154
}
155
155
```
@@ -170,7 +170,7 @@ During metrics validation, if no metrics are provided then a warning will be log
170
170
[Metrics(Namespace = "ExampleApplication", Service = "Booking")]
171
171
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
172
172
{
173
- Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT );
173
+ Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count );
174
174
}
175
175
}
176
176
```
@@ -271,7 +271,7 @@ You can add high-cardinality data as part of your Metrics log with `AddMetadata`
271
271
[Metrics(Namespace = ExampleApplication, Service = "Booking")]
272
272
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
273
273
{
274
- Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.COUNT );
274
+ Metrics.AddMetric("SuccessfulBooking", 1, MetricUnit.Count );
275
275
Metrics.AddMetadata("BookingId", "683EEB2D-B2F3-4075-96EE-788E6E2EED45");
276
276
...
277
277
```
@@ -327,7 +327,7 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use **`PushSing
327
327
Metrics.PushSingleMetric(
328
328
metricName: "ColdStart",
329
329
value: 1,
330
- unit: MetricUnit.COUNT ,
330
+ unit: MetricUnit.Count ,
331
331
nameSpace: "ExampleApplication",
332
332
service: "Booking",
333
333
defaultDimensions: new Dictionary<string, string>
0 commit comments