Skip to content

Commit

Permalink
DOC: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Brien committed Sep 16, 2021
1 parent 7b61919 commit 1212a70
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ The standard DynamoDB metrics provide basic table and index level metrics. Howev

If you've wondered:

* Which app, function is causing the most load and consuming the most RCU/WCU.
* Which customer tenant is causing the most load and consuming the most RCU/WCU.
* Which app or function is causing the most load and consuming the most RCU/WCU.
* Which single-table entity/model is most loaded and consuming RCU/WCU.
* Which operations are being used the most.
* Which queries are the most inefficient (items vs scanned).
* Who is doing scans (app, function, model).

Expand Down Expand Up @@ -75,7 +77,7 @@ If using the AWS V2 SDK with the DocumentClient, create your DynamoDB client.
import DynamoDB from 'aws-sdk/clients/dynamodb'
client: new DynamoDB.DocumentClient({})

or if using the AWS V2 SDK with the low level API
// or if using the AWS V2 SDK with the low level API

const client = new DynamoDB({})
```
Expand All @@ -101,7 +103,7 @@ DynamoDB Metrics creates the following metrics
* scanned — Number of items scanned
* requests — Number of API requests issued

DynamoDB Metrics will create these metrics for the following dimensions:
DynamoDB Metrics will create these metrics for the following dimensions by default:

* Table
* Tenant
Expand All @@ -122,6 +124,8 @@ The Model is the single-table entity name. Read [DynamoDB Single Table Design](h

The operation dimension is set to the DynamoDB operation: getItem, putItem etc.

You can tailor the set of dimensions via the `dimensions` constructor parameter.

## Single Table Configuration

DynamoDB Metrics needs to determine the single-table model/entity for each request so that it can attribute the request to the appropriate entity. And so, Metrics needs to be able to interpret your key attributes in requests and responses. To do this, when constructing the `Metrics` instance you describe your indexes and the hash/sort key separator you are using.
Expand Down Expand Up @@ -227,7 +231,11 @@ Metrics can be dynamically controlled by the LOG_FILTER environment variable. If

## Profiling Queries

You can also profile queries and scans by setting the `queries` parameter to true and passing a `profile` property to the relevant DynamoDB query or scan command. You can set this to any identifying string to describe the query or scan. These metrics are created under the Profile dimension. Note: the Profile dimension is separate and is not listed in the `dimensions` property.
You can also profile queries and scans by setting the `queries` constructor parameter to true and passing a `profile` property to the relevant DynamoDB query or scan command. You can set the profile value to any identifying string to describe the query or scan.

These profile metrics are created under the Profile dimension.

Note: the Profile dimension is separate and is not listed in the `dimensions` constructor parameter.

For example:

Expand Down

0 comments on commit 1212a70

Please sign in to comment.