- Newest
- Most votes
- Most comments
The behavior you're experiencing with ${FIRST_LAST_RANGE} always showing a positive value is likely the intended behavior rather than a bug. Dynamic labels in CloudWatch are designed to provide absolute differences or ranges, which are typically represented as positive values.
When using ${FIRST_LAST_RANGE}, CloudWatch calculates the absolute difference between the first and last data points in the current time range, regardless of which value is larger. This means it will always return a positive value, representing the magnitude of the change rather than the direction.
If you need to show whether the change is positive or negative, you might consider using a different approach. For example, you could use a math expression to calculate the difference and then display it in your label.
Alternatively, you could modify your label to show both the first and last values separately, which would allow viewers to infer the direction of the change. Your current label already does this to some extent with the "range: ${FIRST}...${LAST} USD" part.
If you need to explicitly show a negative value when appropriate, you may need to consider using a custom metric or a more complex math expression to achieve this, as the built-in dynamic label functionality doesn't provide this capability directly.
Remember that the primary purpose of these dynamic labels is to provide quick, at-a-glance information about the metric's behavior over the displayed time range, which is why absolute values are often used.
Sources
Use dynamic labels - Amazon CloudWatch
Editing a graph on a CloudWatch dashboard - Amazon CloudWatch
Relevant content
- Accepted Answerasked 2 years ago
- asked a year ago
- asked 2 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 10 months ago