powertools-lambda-typescript icon indicating copy to clipboard operation
powertools-lambda-typescript copied to clipboard

Bug (metrics): Increase maximum number of metrics dimension from 10 to 30

Open ijemmy opened this issue 3 years ago • 0 comments

Summary

Increase maximum number of metrics dimension from 10 to 30

Bug description

CloudWatch Metrics has increase maximum number of dimensions from 10 to 30 ref.

Currently, metrics utility throws an error when user try to add more than 10 dimension. This should be updated to 30.

Note: Powertools for Python is having the same change in this issue. Note that we DO NOT consider this as breaking change. (See that issue discussion on this)

Expected Behavior

Clients should be able to add up to 30 dimensions before throwing an error.

Current Behavior

Adding more than 10 dimensions will throw an error.

Possible Solution

You can find the relevant code to update in this search.

Required changes are:

  1. Update MAX_DIMENSION_COUNT variable from 9 to 29
  2. Update related unit tests

Steps to Reproduce

Call metrics.addDimension() more then 10 times. See this test case for example.

Environment

  • Powertools version used: all
  • Packaging format (Layers, npm): npm
  • AWS Lambda function runtime: all runtimes
  • Debugging logs: n/a

Related issues, RFCs

ijemmy avatar Aug 04 '22 10:08 ijemmy