-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(aws_cloudwatch_logs sink): add configurable log retention #18865
feat(aws_cloudwatch_logs sink): add configurable log retention #18865
Conversation
👷 Deploy request for vector-project pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for vrl-playground canceled.
|
21d9a58
to
f8cdef9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I have a couple of queries around CloudwatchFuture
. I'm not a massive expert in Cloudwatch, so it's possible they may just arise from my misunderstanding.
As an aside, that future really needs to be rewritten using async/await, but that's probably for another day.
self.state = | ||
State::DeleteRetentionPolicy(self.client.delete_retention_policy()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to not delete the retention policy if one has already been specified. This is the current behaviour and people may be surprised if retention policies start being removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
.limit(1) | ||
.log_group_name_prefix(group_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this sufficient?
- cloudwatch has log group
x1
, vector looking forx
, api call returnsx1
- cloudwatch has log groups
x
ANDx1
, vector looking forx
, we HOPE it returnsx
, but feels like we're depending on some implementation detail for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added filtering for describe_streams and removed describe_groups since it's not needed anymore
33da68f
to
f637e89
Compare
f637e89
to
f649cf9
Compare
@StephenWakely @srstrickland |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I think there's just one more change that needs to be made and then it's good to go.
Thanks for your patience in dealing with this.
Co-authored-by: Stephen Wakely <stephen@lisp.space>
|
||
info!(message = "Retention policy updated for stream.", name = %self.client.stream_name); | ||
|
||
self.state = State::CreateStream(self.client.create_log_stream()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs formatting.. Nearly there..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StephenWakely any other changes needed?
Ah, we face some clippy errors now.
Can you take a look? You can run |
done |
Ok... Hopefully final check. The docs are out of date since we have added a new configuration option. You need to run
and check in the resulting changes. |
@StephenWakely |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, approving with one minor update requested
@@ -639,6 +639,20 @@ base: components: sinks: aws_cloudwatch_logs: configuration: { | |||
} | |||
} | |||
} | |||
retention: { | |||
description: "Retention policy configuration for AWS Cloudwatch Log Group" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: "Retention policy configuration for AWS Cloudwatch Log Group" | |
description: "Retention policy configuration for AWS CloudWatch Log Group" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@buraizu done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. We are getting some document errors now. These errors should have been highlighted when you generated the component docs, but for some reason they weren't.
Thanks for your patience. We really need to improve the process with these checks.
#[derive(Clone, Debug, Default)] | ||
/// Retention policy configuration for AWS CloudWatch Log Group | ||
pub struct Retention { | ||
#[configurable(derived)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[configurable(derived)] | |
/// Whether or not to set a retention policy when creating a new Log Group. |
#[serde(default)] | ||
pub enabled: bool, | ||
|
||
#[configurable(derived)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[configurable(derived)] | |
/// If retention is enabled, the number of days to retain logs for. |
deserialize_with = "retention_days", | ||
skip_serializing_if = "crate::serde::skip_serializing_if_default" | ||
)] | ||
pub days: i32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub days: i32, | |
pub days: u32, |
Unfortunately, the docs aren't able to work with i32
. u32
should be fine here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Can you also run |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you very much for seeing this through.
Regression Detector ResultsRun ID: f4c49727-8e08-4c97-885b-b1bddc57f5af ExplanationA regression test is an integrated performance test for Because a target's optimization goal performance in each experiment will vary somewhat each time it is run, we can only estimate mean differences in optimization goal relative to the baseline target. We express these differences as a percentage change relative to the baseline target, denoted "Δ mean %". These estimates are made to a precision that balances accuracy and cost control. We represent this precision as a 90.00% confidence interval denoted "Δ mean % CI": there is a 90.00% chance that the true value of "Δ mean %" is in that interval. We decide whether a change in performance is a "regression" -- a change worth investigating further -- if both of the following two criteria are true:
The table below, if present, lists those experiments that have experienced a statistically significant change in mean optimization goal performance between baseline and comparison SHAs with 90.00% confidence OR have been detected as newly erratic. Negative values of "Δ mean %" mean that baseline is faster, whereas positive values of "Δ mean %" mean that comparison is faster. Results that do not exhibit more than a ±5.00% change in their mean optimization goal are discarded. An experiment is erratic if its coefficient of variation is greater than 0.1. The abbreviated table will be omitted if no interesting change is observed. No interesting changes in experiment optimization goals with confidence ≥ 90.00% and |Δ mean %| ≥ 5.00%. Fine details of change detection per experiment.
|
…rdotdev#18865) * enable cloudwatch logs sink retention * MR comments Co-authored-by: Stephen Wakely <stephen@lisp.space> * make fmt * fixed warnings * generated docs * pr comments * pr comments * generated docs --------- Co-authored-by: Stephen Wakely <stephen@lisp.space>
When is this supposed to be released? |
We are aiming to release v0.35 later today (8th Jan) which will include this change. |
…rdotdev#18865) * enable cloudwatch logs sink retention * MR comments Co-authored-by: Stephen Wakely <stephen@lisp.space> * make fmt * fixed warnings * generated docs * pr comments * pr comments * generated docs --------- Co-authored-by: Stephen Wakely <stephen@lisp.space>
Fixes #12038