You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/metrics.md
+26-8Lines changed: 26 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,16 +118,15 @@ Metrics has two global settings that will be used across all metrics emitted. Us
118
118
119
119
!!! tip "Use your application or main service as the metric namespace to easily group all metrics"
120
120
121
-
<!-- prettier-ignore-start -->
122
-
!!!info "Order of Precedence of `MetricsLogger` configuration"
123
-
The `MetricsLogger` Singleton can be configured by three different interfaces. The following order of precedence applies:
121
+
### Order of Precedence of `MetricsLogger` configuration
124
122
125
-
1. `@Metrics` annotation (recommended)
126
-
2. `MetricsLoggerBuilder` using Builder pattern (see [Advanced section](#usage-without-metrics-annotation))
127
-
3. Environment variables (recommended)
123
+
The `MetricsLogger` Singleton can be configured by three different interfaces. The following order of precedence applies:
128
124
129
-
For most use-cases, we recommend using Environment variables and only overwrite settings in code where needed using either the `@Metrics` annotation or `MetricsLoggerBuilder` if the annotation cannot be used.
130
-
<!-- prettier-ignore-end -->
125
+
1.`@Metrics` annotation
126
+
2.`MetricsLoggerBuilder` using Builder pattern (see [Advanced section](#usage-without-metrics-annotation))
127
+
3. Environment variables (recommended)
128
+
129
+
For most use-cases, we recommend using Environment variables and only overwrite settings in code where needed using either the `@Metrics` annotation or `MetricsLoggerBuilder` if the annotation cannot be used.
131
130
132
131
=== "template.yaml"
133
132
@@ -302,6 +301,25 @@ You can also specify a custom function name to be used in the cold start metric:
302
301
}
303
302
```
304
303
304
+
<!-- prettier-ignore-start -->
305
+
!!!tip "You can overwrite the default `Service` and `FunctionName` dimensions of the cold start metric"
306
+
Set `#!java @Metrics(captureColdStart = false)` and use the `captureColdStartMetric` method manually:
307
+
308
+
```java hl_lines="6 8"
309
+
public class MetricsColdStartCustomFunction implements RequestHandler<Object, Object> {
310
+
311
+
private static final MetricsLogger metricsLogger = MetricsLoggerFactory.getMetricsLogger();
312
+
313
+
@Override
314
+
@Metrics(captureColdStart = false)
315
+
public Object handleRequest(Object input, Context context) {
0 commit comments