Skip to content

Commit 58bfcdf

Browse files
authored
docs: minor improvements (#1021)
* docs: consistency with blog post messaging, added one-line installation command, reduce font size * docs: add middy link, add ToC items for CTAs
1 parent 5438f72 commit 58bfcdf

File tree

10 files changed

+199
-50
lines changed

10 files changed

+199
-50
lines changed

README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# AWS Lambda Powertools for TypeScript
22

3-
A suite of TypeScript utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. (AWS Lambda Powertools for [Python](https://github.com/awslabs/aws-lambda-powertools-python) and AWS Lambda Powertools for [Java](https://github.com/awslabs/aws-lambda-powertools-java) are also available).
3+
A suite of utilities for AWS Lambda functions to ease the adoption of best practices such as tracing, structured logging, custom metrics, and more.
4+
You can use the library in both TypeScript and JavaScript code bases.
5+
AWS Lambda Powertools for [Python](https://github.com/awslabs/aws-lambda-powertools-python) and AWS Lambda Powertools for [Java](https://github.com/awslabs/aws-lambda-powertools-java) are also available).
46

5-
**[📜 Documentation](https://awslabs.github.io/aws-lambda-powertools-typescript/)** | **[NPM](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://github.com/awslabs/aws-lambda-powertools-roadmap/projects/1)** | **[Examples](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples)**
6-
7-
> **An AWS Developer Acceleration (DevAx) initiative by Specialist Solution Architects | [email protected]**
7+
**[📜 Documentation](https://awslabs.github.io/aws-lambda-powertools-typescript/)** | **[NPM](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://github.com/awslabs/aws-lambda-powertools-roadmap/projects/1)** | **[Examples](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples)** | **[Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo)**
88

99
## Table of contents
1010

1111
- [Features](#features)
1212
- [Getting started](#getting-started)
1313
- [Installation](#installation)
1414
- [Examples](#examples)
15-
- [Credits](#credits)
15+
- [Serverless TypeScript Demo](#serverless-typescript-demo-application)
16+
- [Contribute](#contribute)
17+
- [Roadmap](#roadmap)
1618
- [Connect](#connect)
19+
- [Credits](#credits)
1720
- [License](#license)
1821

1922
## Features
@@ -31,6 +34,14 @@ Find the complete project's [documentation here](https://awslabs.github.io/aws-l
3134
The AWS Lambda Powertools for TypeScript utilities follow a modular approach, similar to the official [AWS SDK v3 for JavaScript](https://github.com/aws/aws-sdk-js-v3).
3235
Each TypeScript utility is installed as standalone NPM package.
3336

37+
Install all three core utilities at once with this single command:
38+
39+
```shell
40+
npm install @aws-lambda-powertools/logger @aws-lambda-powertools/tracer @aws-lambda-powertools/metrics
41+
```
42+
43+
Or refer to the installation guide of each utility:
44+
3445
👉 [Installation guide for the **Tracer** utility](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/tracer#getting-started)
3546

3647
👉 [Installation guide for the **Logger** utility](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/logger#getting-started)
@@ -42,15 +53,29 @@ Each TypeScript utility is installed as standalone NPM package.
4253
* [CDK](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/cdk)
4354
* [SAM](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/sam)
4455

45-
## Credits
56+
### Serverless TypeScript Demo application
4657

47-
* Credits for the Lambda Powertools idea go to [DAZN](https://github.com/getndazn) and their [DAZN Lambda Powertools](https://github.com/getndazn/dazn-lambda-powertools/).
58+
The [Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo) shows how to use Lambda Powertools for TypeScript.
59+
You can find instructions on how to deploy and load test this application in the [repository](https://github.com/aws-samples/serverless-typescript-demo).
60+
61+
## Contribute
62+
63+
If you are interested in contributing to this project, please refer to our [Contributing Guidelines](https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/CONTRIBUTING.md).
64+
65+
## Roadmap
66+
67+
The roadmap of Powertools is driven by customers’ demand.
68+
Help us prioritize upcoming functionalities or utilities by [upvoting existing RFCs and feature requests](https://github.com/awslabs/aws-lambda-powertools-typescript/issues), or [creating new ones[(https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new/choose), in this GitHub repository.
4869

4970
## Connect
5071

5172
* **AWS Developers Slack**: `#lambda-powertools` - **[Invite, if you don't have an account](https://join.slack.com/t/awsdevelopers/shared_invite/zt-yryddays-C9fkWrmguDv0h2EEDzCqvw)**
5273
* **Email**: [email protected]
5374

75+
## Credits
76+
77+
Credits for the Lambda Powertools idea go to [DAZN](https://github.com/getndazn) and their [DAZN Lambda Powertools](https://github.com/getndazn/dazn-lambda-powertools/).
78+
5479
## License
5580

5681
This library is licensed under the MIT-0 License. See the LICENSE file.

docs/core/logger.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ Logger provides an opinionated logger with output structured as JSON.
77

88
## Key features
99

10-
* Capture key fields from Lambda context, cold start and structure logging output as JSON
11-
* Log Lambda event when instructed (disabled by default)
12-
* Log sampling prints all the logs for a percentage of invocations (disabled by default)
13-
* Append additional keys to structured log at any point in time
10+
* Capturing key fields from the Lambda context, cold starts, and structure logging output as JSON.
11+
* Logging Lambda invocation events when instructed (disabled by default).
12+
* Printing all the logs only for a percentage of invocations via log sampling (disabled by default).
13+
* Appending additional keys to structured logs at any point in time.
14+
* Providing a custom log formatter (Bring Your Own Formatter) to output logs in a structure compatible with your organization’s Logging RFC.
1415

1516
## Getting started
1617

docs/core/metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ These metrics can be visualized through [Amazon CloudWatch Console](https://cons
99

1010
## Key features
1111

12-
* Aggregate up to 100 metrics using a single CloudWatch EMF object (large JSON blob)
13-
* Validate against common metric definitions mistakes (metric unit, values, max dimensions, max metrics, etc)
14-
* Metrics are created asynchronously by CloudWatch service, no custom stacks needed
15-
* Context manager to create a one off metric with a different dimension
12+
* Aggregating up to 100 metrics using a single CloudWatch EMF object (large JSON blob).
13+
* Validating your metrics against common metric definitions mistakes (for example, metric unit, values, max dimensions, max metrics).
14+
* Metrics are created asynchronously by the CloudWatch service. You do not need any custom stacks, and there is no impact to Lambda function latency.
15+
* Creating a one-off metric with different dimensions.
1616

1717
## Terminologies
1818

docs/core/tracer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Tracer is an opinionated thin wrapper for [AWS X-Ray SDK for Node.js](https://gi
77

88
## Key features
99

10-
* Auto capture cold start and service name as annotations, and responses or full exceptions as metadata
11-
* Auto-disable when not running in AWS Lambda environment
12-
* Automatically trace HTTP(s) clients and generate segments for each request
13-
* Support tracing functions via decorators, middleware, and manual instrumentation
14-
* Support tracing AWS SDK v2 and v3 via AWS X-Ray SDK for Node.js
10+
* Auto-capturing cold start and service name as annotations, and responses or full exceptions as metadata.
11+
* Automatically tracing HTTP(S) clients and generating segments for each request.
12+
* Supporting tracing functions via decorators, middleware, and manual instrumentation.
13+
* Supporting tracing AWS SDK v2 and v3 via AWS X-Ray SDK for Node.js.
14+
* Auto-disable tracing when not running in the Lambda environment.
1515

1616
![Tracer showcase](../media/tracer_utility_showcase.png)
1717

docs/index.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: Homepage
33
description: AWS Lambda Powertools for TypeScript
44
---
55

6-
AWS Lambda Powertools for TypeScript provides a suite of utilities for AWS Lambda functions running on the Node.js runtime, to ease the adoption of best practices such as tracing, structured logging, custom metrics, and more.
6+
AWS Lambda Powertools for TypeScript provides a suite of utilities for AWS Lambda functions running on the Node.js runtime, to ease the adoption of best practices such as tracing, structured logging, custom metrics, and more.
7+
You can use the library in both TypeScript and JavaScript code bases.
78

89
## Tenets
910

@@ -20,7 +21,7 @@ Core utilities such as Tracer, Logger, Metrics, and Event Handler will be availa
2021

2122
| Utility | Description
2223
| ------------------------------------------------- | ---------------------------------------------------------------------------------
23-
[Tracer](./core/tracer.md) | Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions
24+
[Tracer](./core/tracer.md) | Trace Lambda function handlers, and both synchronous and asynchronous functions
2425
[Logger](./core/logger.md) | Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context
2526
[Metrics](./core/metrics.md) | Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF)
2627

@@ -29,12 +30,28 @@ Core utilities such as Tracer, Logger, Metrics, and Event Handler will be availa
2930
The AWS Lambda Powertools for TypeScript utilities (which from here will be referred as Powertools) follow a modular approach, similar to the official [AWS SDK v3 for JavaScript](https://github.com/aws/aws-sdk-js-v3).
3031
Each TypeScript utility is installed as standalone NPM package.
3132

33+
Install all three core utilities at once with this single command:
34+
35+
```shell
36+
npm install @aws-lambda-powertools/logger @aws-lambda-powertools/tracer @aws-lambda-powertools/metrics
37+
```
38+
39+
Or refer to the installation guide of each utility:
40+
3241
[Installation guide for the **Tracer** utility](./core/tracer.md#getting-started)
3342

3443
[Installation guide for the **Logger** utility](./core/logger.md#getting-started)
3544

3645
[Installation guide for the **Metrics** utility](./core/metrics.md#getting-started)
3746

47+
## Instrumentation
48+
49+
You can instrument your code with Powertools in three different ways:
50+
51+
* **Middy** middleware. It is the best choice if your existing code base relies on the [Middy](https://middy.js.org/docs/) middleware engine. Powertools offers compatible Middy middleware to make this integration seamless.
52+
* **Method decorator**. Use [TypeScript method decorators](https://www.typescriptlang.org/docs/handbook/decorators.html#method-decorators) if you prefer writing your business logic using TypeScript Classes. If you aren’t using Classes, this requires the most significant refactoring.
53+
* **Manually**. It provides the most granular control. It’s the most verbose approach, with the added benefit of no additional dependency and no refactoring to [TypeScript Classes](https://www.typescriptlang.org/docs/handbook/classes.html).
54+
3855
## Environment variables
3956

4057
!!! info
@@ -50,14 +67,18 @@ Each TypeScript utility is installed as standalone NPM package.
5067
| **POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS** | Captures HTTP(s) requests as segments. | [Tracer](./core/tracer) | `true` |
5168
| **POWERTOOLS_LOGGER_LOG_EVENT** | Logs incoming event | [Logger](./core/logger) | `false` |
5269
| **POWERTOOLS_LOGGER_SAMPLE_RATE** | Debug log sampling | [Logger](./core/logger) | `0` |
53-
| **POWERTOOLS_LOGGER_LOG_EVENT** | Logs incoming events | [Logger](./core/logger) | `false` |
5470
| **LOG_LEVEL** | Sets logging level | [Logger](./core/logger) | `INFO` |
5571

5672
## Examples
5773

5874
* [CDK](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/cdk){target="_blank"}
5975
* [SAM](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/sam){target="_blank"}
6076

77+
## Serverless TypeScript demo application
78+
79+
The [Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo) shows how to use Lambda Powertools for TypeScript.
80+
You can find instructions on how to deploy and load test this application in the [repository](https://github.com/aws-samples/serverless-typescript-demo).
81+
6182
## Credits
6283

6384
* Credits for the Lambda Powertools idea go to [DAZN](https://github.com/getndazn){target="_blank"} and their [DAZN Lambda Powertools](https://github.com/getndazn/dazn-lambda-powertools/){target="_blank"}.

docs/stylesheets/extra.css

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
.md-grid {
2-
max-width: 81vw;
1+
@font-face {
2+
font-size: 0.65rem;
33
}
44

5-
.md-typeset table:not([class]) {
6-
font-size: 0.75rem;
5+
.md-grid {
6+
max-width: 81vw;
77
}
88

99
.md-typeset a {
1010
border-bottom: 0.1px dashed black;
1111
}
1212

13-
.md-typeset table:not([class]) {
14-
font-size: 0.75rem;
15-
}
16-
1713
.md-nav__link--active {
1814
font-weight: bold;
1915
}

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ theme:
3434
- navigation.sections
3535
- navigation.expand
3636
- navigation.top
37+
- toc.follow
3738
- navigation.instant
3839
- navigation.indexes
3940
- navigation.tracking
4041
- content.code.annotate
42+
- toc.integrate
4143
icon:
4244
repo: fontawesome/brands/github
4345
logo: media/aws-logo-light.svg

packages/logger/README.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
# AWS Lambda Powertools for TypeScript
22

3-
A suite of TypeScript utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. (AWS Lambda Powertools for [Python](https://github.com/awslabs/aws-lambda-powertools-python) and AWS Lambda Powertools for [Java](https://github.com/awslabs/aws-lambda-powertools-java) are also available).
3+
A suite of utilities for AWS Lambda functions to ease the adoption of best practices such as tracing, structured logging, custom metrics, and more.
4+
You can use the library in both TypeScript and JavaScript code bases.
5+
AWS Lambda Powertools for [Python](https://github.com/awslabs/aws-lambda-powertools-python) and AWS Lambda Powertools for [Java](https://github.com/awslabs/aws-lambda-powertools-java) are also available).
46

5-
**[📜 Documentation](https://awslabs.github.io/aws-lambda-powertools-typescript/)** | **[NPM](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://github.com/awslabs/aws-lambda-powertools-roadmap/projects/1)** | **[Examples](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples)**
7+
**[📜 Documentation](https://awslabs.github.io/aws-lambda-powertools-typescript/)** | **[NPM](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://github.com/awslabs/aws-lambda-powertools-roadmap/projects/1)** | **[Examples](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples)** | **[Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo)**
68

7-
> **An AWS Developer Acceleration (DevAx) initiative by Specialist Solution Architects | [email protected]**
9+
## Table of contents
10+
11+
- [Features](#features)
12+
- [Getting started](#getting-started)
13+
- [Installation](#installation)
14+
- [Examples](#examples)
15+
- [Serverless TypeScript Demo](#serverless-typescript-demo-application)
16+
- [Contribute](#contribute)
17+
- [Roadmap](#roadmap)
18+
- [Connect](#connect)
19+
- [Credits](#credits)
20+
- [License](#license)
821

922
## Features
1023

1124
* **[Tracer](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/tracer/)** - Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions
1225
* **[Logger](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/logger/)** - Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context
1326
* **[Metrics](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF)
1427

15-
1628
## Getting started
1729

1830
Find the complete project's [documentation here](https://awslabs.github.io/aws-lambda-powertools-typescript).
@@ -22,6 +34,14 @@ Find the complete project's [documentation here](https://awslabs.github.io/aws-l
2234
The AWS Lambda Powertools for TypeScript utilities follow a modular approach, similar to the official [AWS SDK v3 for JavaScript](https://github.com/aws/aws-sdk-js-v3).
2335
Each TypeScript utility is installed as standalone NPM package.
2436

37+
Install all three core utilities at once with this single command:
38+
39+
```shell
40+
npm install @aws-lambda-powertools/logger @aws-lambda-powertools/tracer @aws-lambda-powertools/metrics
41+
```
42+
43+
Or refer to the installation guide of each utility:
44+
2545
👉 [Installation guide for the **Tracer** utility](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/tracer#getting-started)
2646

2747
👉 [Installation guide for the **Logger** utility](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/logger#getting-started)
@@ -33,15 +53,29 @@ Each TypeScript utility is installed as standalone NPM package.
3353
* [CDK](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/cdk)
3454
* [SAM](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/sam)
3555

36-
## Credits
56+
### Serverless TypeScript Demo application
57+
58+
The [Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo) shows how to use Lambda Powertools for TypeScript.
59+
You can find instructions on how to deploy and load test this application in the [repository](https://github.com/aws-samples/serverless-typescript-demo).
3760

38-
* Credits for the Lambda Powertools idea go to [DAZN](https://github.com/getndazn) and their [DAZN Lambda Powertools](https://github.com/getndazn/dazn-lambda-powertools/).
61+
## Contribute
62+
63+
If you are interested in contributing to this project, please refer to our [Contributing Guidelines](https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/CONTRIBUTING.md).
64+
65+
## Roadmap
66+
67+
The roadmap of Powertools is driven by customers’ demand.
68+
Help us prioritize upcoming functionalities or utilities by [upvoting existing RFCs and feature requests](https://github.com/awslabs/aws-lambda-powertools-typescript/issues), or [creating new ones[(https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new/choose), in this GitHub repository.
3969

4070
## Connect
4171

42-
* **AWS Developers Slack**: `#lambda-powertools`- **[Invite, if you don't have an account](https://join.slack.com/t/awsdevelopers/shared_invite/zt-yryddays-C9fkWrmguDv0h2EEDzCqvw)**
72+
* **AWS Developers Slack**: `#lambda-powertools` - **[Invite, if you don't have an account](https://join.slack.com/t/awsdevelopers/shared_invite/zt-yryddays-C9fkWrmguDv0h2EEDzCqvw)**
4373
* **Email**: [email protected]
4474

75+
## Credits
76+
77+
Credits for the Lambda Powertools idea go to [DAZN](https://github.com/getndazn) and their [DAZN Lambda Powertools](https://github.com/getndazn/dazn-lambda-powertools/).
78+
4579
## License
4680

47-
This library is licensed under the MIT-0 License. See the LICENSE file.
81+
This library is licensed under the MIT-0 License. See the LICENSE file.

0 commit comments

Comments
 (0)