Skip to content

Commit bc77747

Browse files
committed
refactor(metrics): update usage examples to follow new naming convention of throwOnEmptyMetrics property
1 parent 11d7e29 commit bc77747

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: examples/cdk/lib/example-function.MyFunction.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const handler = async (_event: unknown, context: Context): Promise<void>
2929

3030
// ### Experiment metrics
3131
metrics.captureColdStartMetric();
32-
metrics.raiseOnEmptyMetrics();
32+
metrics.throwOnEmptyMetrics();
3333
metrics.setDefaultDimensions({ environment: 'example', type: 'standardFunction' });
3434
metrics.addMetric('test-metric', MetricUnits.Count, 10);
3535

@@ -38,7 +38,7 @@ export const handler = async (_event: unknown, context: Context): Promise<void>
3838
metricWithItsOwnDimensions.addMetric('single-metric', MetricUnits.Percent, 50);
3939

4040
metrics.purgeStoredMetrics();
41-
metrics.raiseOnEmptyMetrics();
41+
metrics.throwOnEmptyMetrics();
4242

4343
// ### Experiment tracer
4444

Diff for: examples/cdk/lib/example-function.MyFunctionWithDecorator.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class MyFunctionWithDecorator {
1515
@logger.injectLambdaContext()
1616
@metrics.logMetrics({
1717
captureColdStartMetric: true,
18-
raiseOnEmptyMetrics: true,
18+
throwOnEmptyMetrics: true,
1919
defaultDimensions: { environment: 'example', type: 'withDecorator' },
2020
})
2121
public handler(_event: unknown, _context: Context, _callback: Callback<unknown>): void | Promise<unknown> {

0 commit comments

Comments
 (0)