awslabs / awslabs/aws-embedded-metrics-node
Noop If Empty Metrics?
- Dominant language
- TypeScript
- Stars
- 263
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
I'm using the following code to have only one dimension.
```javascript
metrics.setDimensions();
```
In some cases for my Lambda there will not be any metrics. However, I have noticed in my log that an empty metric is published. For example:
```
{"executionEnvironment":"AWS_Lambda_nodejs12.x","memorySize":"1792","functionVersion":"$LATEST","logStreamId":"2020/07/12/[$LATEST]9a0092bb2cf76b6b90c46bf429a32aef","traceId":"Root=1-dc99d00f-c079a84d433534434534ef0d;Parent=91ed514f1e5c03b2;Sampled=1","_aws":{"Timestamp":1594571647673,"CloudWatchMetrics":[{"Dimensions":[],"Metrics":[],"Namespace":"MyApp"}]}}
```
Should this library check for dimension/metric presence before sending the output?
Contributor guide
Research direction
Start by tracing metrics.setDimensions() through the metric publishing path and inspect how empty dimensions and metrics are serialized for AWS Lambda. Done should mean that an invocation with no metrics does not publish an empty metric payload, with existing metric publishing behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, typescript
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100