elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
103 stars 4.92k forks source link

[8.x](backport #40870) [AWS CloudWatch Metrics] Record previous endTime to use for next collection period #40930

Closed mergify[bot] closed 1 month ago

mergify[bot] commented 1 month ago

Proposed commit message

This PR is to record the previous endTime from the previous collection period to use for calculating the next collection start time and end time. With using the previous endTime as the new startTime, we will not skip time range in collection.

This PR also changes log.logger from cloudwatch to aws.cloudwatch to match the other logger.

Checklist

Disruptive User Impact

N/A. User will see no gap in collection startTime and endTime, should be an enhancement.

How to test this PR locally

  1. Pull this PR and run mage build to build Metricbeat locally.
  2. ./metricbeat modules enable aws
  3. Configure in aws.yml:
    - module: aws
    period: 5m
    metricsets:
    - cloudwatch
    include_linked_accounts: true
    metrics:
    - namespace: AWS/RDS
  4. Run metricbeat with debug log on
  5. Check metricbeat log to make sure startTime and endTime are connected for all collection periods.
    This is an automatic backport of pull request #40870 done by Mergify.
botelastic[bot] commented 1 month ago

This pull request doesn't have a Team:<team> label.