Skip to content
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

[PR #2286/118905b8 backport][stable-8] cloudwatchlogs_log_group_metric_filter: add support for unit and dimensions #2361

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Oct 24, 2024

This is a backport of PR #2286 as merged into main (118905b).

SUMMARY

This PR adds support for the options unit and dimensions in the cloudwatchlogs_log_group_metric_filter module.
This enables configuring unit and dimensions in Cloudwatch Logs Metricfilters using ansible, which was previously not possible.

The addition is pretty straigthforward since both unit and dimensions are part of the metric_transformation parameter.

dimensions and default_value are mutually exclusive, however:

  1. The AWS API does not fail when both are present, instead the dimensions are simply ignored.
  2. Since they are not top-level parameters, the ansible module option mutually_exclusive was not possible. Instead a custom check was added to the module that throws an error when both parameters are present.

An integration test has been added for this case, as well as for configuring metric_filters with units and/or dimensions.

The function metricTransformationHandler has been rewritten slightly due to the addition of the two extra optional parameters, to make it a bit more readable.

Happy to get your feedback!

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cloudwatchlogs_log_group_metric_filter

ADDITIONAL INFORMATION

…nsions (#2286)

SUMMARY

This PR adds support for the options unit and dimensions in the cloudwatchlogs_log_group_metric_filter module.
This enables configuring unit and dimensions in Cloudwatch Logs Metricfilters using ansible, which was previously not possible.
The addition is pretty straigthforward since both unit and dimensions are part of the metric_transformation parameter.
dimensions and default_value are mutually exclusive, however:

The AWS API does not fail when both are present, instead the dimensions are simply ignored.
Since they are not top-level parameters, the ansible module option mutually_exclusive was not possible. Instead a custom check was added to the module that throws an error when both parameters are present.

An integration test has been added for this case, as well as for configuring metric_filters with units and/or dimensions.
The function metricTransformationHandler has been rewritten slightly due to the addition of the two extra optional parameters, to make it a bit more readable.
Happy to get your feedback!

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

cloudwatchlogs_log_group_metric_filter
ADDITIONAL INFORMATION

Reviewed-by: GomathiselviS <[email protected]>
Reviewed-by: Jasper Misset
Reviewed-by: Alina Buzachis
(cherry picked from commit 118905b)
Copy link

github-actions bot commented Oct 24, 2024

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/2b67475bffff42b9a820d04e22dc96f3

✔️ ansible-galaxy-importer SUCCESS in 4m 38s
✔️ build-ansible-collection SUCCESS in 10m 23s
✔️ ansible-test-splitter SUCCESS in 3m 50s
✔️ integration-amazon.aws-1 SUCCESS in 5m 36s
Skipped 43 jobs

@alinabuzachis alinabuzachis added the mergeit Merge the PR (SoftwareFactory) label Oct 25, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/36e4688c8ec546d5af2c369cce0682f5

✔️ ansible-galaxy-importer SUCCESS in 4m 10s
✔️ build-ansible-collection SUCCESS in 11m 17s
✔️ ansible-test-splitter SUCCESS in 4m 07s
✔️ integration-amazon.aws-1 SUCCESS in 6m 38s
Skipped 43 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit a5d458a into stable-8 Oct 25, 2024
37 checks passed
@softwarefactory-project-zuul softwarefactory-project-zuul bot deleted the patchback/backports/stable-8/118905b8004526bfc8289ba41e0ac3d053d347c6/pr-2286 branch October 25, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants