Merged
Conversation
Comment on lines
+5
to
+8
| def self.log(action, key_id:, context: nil, log_context: nil) | ||
| output = { | ||
| kms: { | ||
| timestamp: Time.zone.now, |
Contributor
There was a problem hiding this comment.
Suggested change
| def self.log(action, key_id:, context: nil, log_context: nil) | |
| output = { | |
| kms: { | |
| timestamp: Time.zone.now, | |
| def self.log(action:, timestamp:, key_id:, context: nil, log_context: nil) | |
| output = { | |
| kms: { | |
| timestamp: timestamp, |
I wonder if it might be preferable to pass the time as an argument? Would have some implications around the tests, but I suspect they will require freezing time.
mitchellhenke
approved these changes
Mar 3, 2025
Contributor
Author
|
Confirming logs after updates: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Adds a timestamp to kms.log. Currently, when logs from kms.log are ingested into Cloudwatch, the cloudwatch-agent uses the current time as the timestamp. This can be skewed by up to 150s from when the kms event was actually logged.
Before (CloudTrail event time: 2025-02-28T13:17:19Z):
After (CloudTrail event time: 2025-02-28T14:17:54Z):