aws / aws/amazon-cloudwatch-agent

Negative value for custom metric

Open
#739 2 comments 5 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
550
Forks
271
Avg merge
1d 21h
Merged PRs (30d)
13

Description

**Is your feature request related to a problem? Please describe.**
I'm using amazon-cloudwatch-agent for putting custom metrics from the application and was badly surprised when tried to push negative value for gauge type because it does not support:
```
2023-04-19T11:35:21Z W! error: negative value, metric service.metric.seconds, value -0.9775779816513761
2023-04-19T11:44:30Z W! error: negative value, metric service.metric.seconds, value -0.9775779816513761
```

**Describe the solution you'd like**
Add supporting negative values for custom metrics.

**Describe alternatives you've considered**
aws cli did it well:
```bash
aws cloudwatch put-metric-data --region ap-northeast-1 --metric-name CustomTestMetric --namespace MyService --value -5 --timestamp 2023-04-19T15:00:02.000Z
```

**Additional context**
-

Contributor guide

Open the contributing guide

Research direction

No files or tests are named in the issue. Start by tracing the custom-metric path that emits the “negative value” error and compare its behavior with the AWS CLI example. Done means custom gauge metrics accept negative values, with tests covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.