feat: Introduce lastSync start position to AWS CloudWatch input backed by state registry#43251
Conversation
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
91bfda9 to
fecf38d
Compare
MichaelKatsoulis
left a comment
There was a problem hiding this comment.
LGTM.
Very good work! I have only left some small comments.
86c2166 to
1cdaf6a
Compare
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
6507477 to
6eefa92
Compare
VihasMakwana
left a comment
There was a problem hiding this comment.
LGTM, @MichaelKatsoulis has already given his approval and code looks good.
6eefa92 to
d064c6e
Compare
faec
left a comment
There was a problem hiding this comment.
Thanks, looks good but one last very small but important change
faec
left a comment
There was a problem hiding this comment.
Thanks for all your work on this! Approved.
Thank you @faec for the detailed review 🙏 |
|
@elastic/beats-tech-leads - can I get a final approval :) |
ebeahan
left a comment
There was a problem hiding this comment.
@Kavindu-Dodan question about the backporting label. If this is a new feature, should we only target landing in 8.19 & 9.1 instead of backport-active-all?
Good point, plan was to merge only the necessary 9.1.x & 8.19.x and reject others. But I think that adds confusion so I will add only the needed :) update - I have updated the labels :) |
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> finalize AWS CW lastSync start position usage Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> update changelog next Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> review changes - improve state store id, fix timestamp and return nil for error Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> documentation update with md migration Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # x-pack/filebeat/input/awscloudwatch/config.go
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
…n handling Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
5782ba9 to
4ab81a4
Compare
…d by state registry (#43251) * add state registry support for cloudwatch input Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> finalize AWS CW lastSync start position usage Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> update changelog next Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> review changes - improve state store id, fix timestamp and return nil for error Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> documentation update with md migration Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # x-pack/filebeat/input/awscloudwatch/config.go * review change: use ackers for confirmed delivery prior to saving state Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review: documentation updates Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes : ctx handling, shutdown improvement and race condition handling Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review : fix ctx condition Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 42e50cf) # Conflicts: # docs/reference/filebeat/filebeat-input-aws-cloudwatch.md
…S CloudWatch input backed by state registry (#44736) * feat: Introduce lastSync start position to AWS CloudWatch input backed by state registry (#43251) * add state registry support for cloudwatch input Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> finalize AWS CW lastSync start position usage Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> update changelog next Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> review changes - improve state store id, fix timestamp and return nil for error Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> documentation update with md migration Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # x-pack/filebeat/input/awscloudwatch/config.go * review change: use ackers for confirmed delivery prior to saving state Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review: documentation updates Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes : ctx handling, shutdown improvement and race condition handling Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review : fix ctx condition Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 42e50cf) # Conflicts: # docs/reference/filebeat/filebeat-input-aws-cloudwatch.md * Update CHANGELOG.next.asciidoc * update CloudWatch documentation for backport Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com> Co-authored-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Proposed commit message
Introduce
lastSyncoption to AWS CloudWatch input'sstart_positionconfiguration. This feature utilizes the state registry, which with this update stores the last successful sync timestamp under thelast_sync_epochkey.start_positionconfiguration by default usesbeginningoption. This can cause data duplications when restarting filebeats or migrating it to a newer version. Users can avoid such data duplocates by utilizinglastSyncoption for thestart_positionconfiguration while targeting beats to use the same registry location.Acknowledgement backed state updates
After the initial review, the need for acknowledgments prior to the state registry update was identified thanks to this remark - #43251 (comment)
Based on this feedback, I have implemented the state registry update with following component interactions,
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
None -
start_positionby default usebeginning. So this new option is an opt-in feature.Screenshots
Example
filebeat.ymlconfiguration,Example state entries with last sync timestamp updates,