influxdata / influxdata/telegraf

inputs.cloudwatch: query metrics from [$delay:$now] interval

Open
#15,415 4 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Use Case

Cloudwatch can be very instable in delivering metrics in time: delays can be from minutes to half an hour in some cases. If one wants to avoid gaps in collected metrics, then `delay` param has to be set sufficiently back in time to cover possible delays. It is then calculates delayed timestamp as `$delay = $now - delay`.

Telegraf then queries metrics in range `$delay:$delay+period` every `interval` time. It makes metrics always delayed even if Cloudwatch have fresh data. In other words `delay` is set to cover worst case, but it penalizes best case by doing so.

### Expected behavior

It would be good if cloudwatch plugin could be configured to fetch metrics in `$delay:$now` interval, this will allow $delay to be set sufficiently back in time to cover occasional late metrics delivery, yet have freshest possibly data if Cloudwatch has it.

Obviosuly same Cloudwatch data point will be fetched multiple times, which can incur costs , but it is a tradeoff telegraf users might be willing to take.

### Actual behavior

telegraf cueries single datapoint in `$delay:$delay+period` range, thus missing fresher data even if it exists.

### Additional info

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the inputs.cloudwatch plugin and its handling of the delay, period, interval, and CloudWatch metric query range. Check how the current $delay:$delay+period window is formed and how configuration is tested. Done means users can configure queries from $delay:$now while preserving the existing behavior when that option is not enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.