awslabs / awslabs/aws-embedded-metrics-node

Noop If Empty Metrics?

Open
#50 4 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue question
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.