Skip to content

Commit bd217ef

Browse files
committed
Address PR comments on README update
1 parent de85af3 commit bd217ef

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

examples/cdk/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
This is a deployable CDK app that deploys AWS Lambda functions as part of a CloudFormation stack. These Lambda functions use the utilities made available as part of AWS Lambda Powertools (TypeScript) to demonstrate their usage.
44

5-
The example functions, located in the `lib` folder, are triggered automatically when deployed using the CDK construct defined in `lib/example-function.ts`.
5+
You will need to have a valid AWS Account in order to deploy these resources. These resources may incur costs to your AWS Account.
6+
7+
The example functions, located in the `lib` folder, are invoked automatically, twice, when deployed using the CDK construct defined in `lib/example-function.ts`. The first invocation demonstrates the effect on logs/metrics/annotations when the Lambda function has a cold start, and the latter without a cold start.
68

79
## Deploying the stack
810

11+
* Ensure that CDK v2 is installed globally on your machine (if not, run `npm install -g aws-cdk`)
912
* Navigate to this location of the repo in your terminal (`examples/cdk`)
1013
* `npm install`
11-
* `npx cdk deploy --all --profile <YOUR_AWS_PROFILE>`
14+
* `cdk deploy --all --profile <YOUR_AWS_PROFILE>`
1215

13-
Note: Prior to deploying you may need to run `npx cdk bootstrap aws://<YOU_AWS_ACCOUNT_ID>/<AWS_REGION> --profile <YOUR_AWS_PROFILE>` if you have not already bootstrapped your account for CDK.
16+
Note: Prior to deploying you may need to run `cdk bootstrap aws://<YOU_AWS_ACCOUNT_ID>/<AWS_REGION> --profile <YOUR_AWS_PROFILE>` if you have not already bootstrapped your account for CDK.
1417

1518
## Viewing Utility Outputs
1619

17-
All utility outputs can be viewed from the CloudWatch console.
20+
All utility outputs can be viewed in the Amazon CloudWatch console.
1821

19-
* `Logger` outputs to Logs > Log groups
20-
* `Metrics` outputs to Metrics > All metrics > LambdaPowertoolsTypeScript-CDKExample
21-
* `Tracer` outputs to X-Ray traces > Traces
22+
* `Logger` output can be found in Logs > Log groups
23+
* `Metrics` output can be found in Metrics > All metrics > CdkExample
24+
* `Tracer` output can be found in X-Ray traces > Traces

packages/metrics/src/Metrics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class Metrics implements MetricsInterface {
210210
* import { Metrics, MetricUnits } from '@aws-lambda-powertools/metrics';
211211
* import { Callback, Context } from 'aws-lambda';
212212
*
213-
* const metrics = new Metrics({namespace:"LambdaPowertoolsTypeScript-CDKExample", serviceName:"withDecorator"});
213+
* const metrics = new Metrics({namespace:"CdkExample", serviceName:"withDecorator"});
214214
*
215215
* export class MyFunctionWithDecorator {
216216
*
@@ -267,7 +267,7 @@ class Metrics implements MetricsInterface {
267267
* ```typescript
268268
* import { Metrics, MetricUnits } from '@aws-lambda-powertools/metrics';
269269
*
270-
* const metrics = new Metrics({namespace: "LambdaPowertoolsTypeScript-CDKExample", serviceName: "MyFunction"}); // Sets metric namespace, and service as a metric dimension
270+
* const metrics = new Metrics({namespace: "CdkExample", serviceName: "MyFunction"}); // Sets metric namespace, and service as a metric dimension
271271
*
272272
* export const handler = async (_event: any, _context: any) => {
273273
* metrics.addMetric('test-metric', MetricUnits.Count, 10);

packages/metrics/tests/e2e/decorator.test.MyFunction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Metrics, MetricUnits } from '../../src';
22
import { Context } from 'aws-lambda';
33
import { LambdaInterface } from '../../examples/utils/lambda/LambdaInterface';
44

5-
const namespace = process.env.EXPECTED_NAMESPACE ?? 'LambdaPowertoolsTypeScript-CDKExample';
5+
const namespace = process.env.EXPECTED_NAMESPACE ?? 'CdkExample';
66
const serviceName = process.env.EXPECTED_SERVICE_NAME ?? 'MyFunctionWithStandardHandler';
77
const metricName = process.env.EXPECTED_METRIC_NAME ?? 'MyMetric';
88
const metricUnit = (process.env.EXPECTED_METRIC_UNIT as MetricUnits) ?? MetricUnits.Count;

packages/metrics/tests/e2e/standardFunctions.test.MyFunction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Metrics, MetricUnits } from '../../src';
22
import { Context } from 'aws-lambda';
33

4-
const namespace = process.env.EXPECTED_NAMESPACE ?? 'LambdaPowertoolsTypeScript-CDKExample';
4+
const namespace = process.env.EXPECTED_NAMESPACE ?? 'CdkExample';
55
const serviceName = process.env.EXPECTED_SERVICE_NAME ?? 'MyFunctionWithStandardHandler';
66
const metricName = process.env.EXPECTED_METRIC_NAME ?? 'MyMetric';
77
const metricUnit = (process.env.EXPECTED_METRIC_UNIT as MetricUnits) ?? MetricUnits.Count;

0 commit comments

Comments
 (0)