Skip to content

feat: support pulling from cloudwatch metrics #58

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

Merged
merged 1 commit into from
Mar 9, 2023
Merged

feat: support pulling from cloudwatch metrics #58

merged 1 commit into from
Mar 9, 2023

Conversation

jta
Copy link

@jta jta commented Mar 7, 2023

This commit introduces a new submodule, cloudwatch_metrics. Similar to our API snapshot functionality, we set up a eventbridge rule that periodically triggers the lambda with a custom payload.

This payload tells the lambda what metrics to scrape for. Callers of this module can configure metric collection through the period, interval, delay and filters variables.

Users must provide a list of filters. Each filter must have a namespace, and an optional set of metric names and dimensions.

variable "filters" {
description = "List of filters."
type = list(object({
namespace = string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The rationale here is that polling is a cost sensitive measure, and so the API should nudge people towards being specific. If you want a wildcard, you might as well configure a cloudwatch metrics stream.

Copy link
Contributor

@bendrucker bendrucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, all minor comments

jta pushed a commit that referenced this pull request Mar 8, 2023
This commit addresses nits uncovered in #58 which were also applicable
to the snapshot module.
@jta jta requested a review from bendrucker March 8, 2023 17:53
jta pushed a commit that referenced this pull request Mar 8, 2023
This commit addresses nits uncovered in #58 which were also applicable
to the snapshot module.
This commit introduces a new submodule, `cloudwatch_metrics`. Similar to
our API snapshot functionality, we set up a eventbridge rule that
periodically triggers the lambda with a custom payload.

This payload tells the lambda what metrics to scrape for. Callers of
this module can configure metric collection through the `period`,
`interval`, `delay` and `filters` variables.

Users must provide a list of filters. Each filter must have a namespace,
and an optional set of metric names and dimensions.

Co-authored-by: Ben Drucker <bvdrucker@gmail.com>
jta pushed a commit that referenced this pull request Mar 8, 2023
This commit addresses nits uncovered in #58 which were also applicable
to the snapshot module.
@jta jta merged commit 2a9fa1f into main Mar 9, 2023
@jta jta deleted the metrics branch March 9, 2023 00:11
jta pushed a commit that referenced this pull request Mar 9, 2023
This commit addresses nits uncovered in #58 which were also applicable
to the snapshot module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants