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

[AWS] Support owning account for cross account monitoring #40691

Conversation

Kavindu-Dodan
Copy link
Contributor

@Kavindu-Dodan Kavindu-Dodan commented Sep 4, 2024

Proposed commit message

Adds owning_account configuration option for AWS where it accepts a source account ID. Internally, this maps to the ListMetrics API's 1 OwningAccount parameter. Note that include_linked_accounts should be set to true to use the account filtering.

include_linked_accounts: true # default to true, hence can be ignored in configuration yaml
owning_account: 111111111111

See the screenshot below from an actual run with owning account filtering,

Screenshot 2024-09-09 at 10 26 11 AM

In comparison, consider the screenshot below where both monitoring account and linked accounts are visible as there is no filtering for owning_account,

Screenshot 2024-09-10 at 9 48 42 AM

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

None :owning_account is a new configuration

How to test this PR locally

  • Build x-pack metricsbeat
  • Enable AWS monitoring with include_linked_accounts set to true (default is already true) & owning_account account ID
  • Observe metrics data and validate that cloud.account.id match with owning_account ID

Related issues

Closes #40570

Footnotes

  1. https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html#API_ListMetrics_RequestParameters

@Kavindu-Dodan Kavindu-Dodan added enhancement backport-skip Skip notification from the automated backport with mergify labels Sep 4, 2024
@Kavindu-Dodan Kavindu-Dodan requested review from kaiyan-sheng and a team September 4, 2024 16:48
@Kavindu-Dodan Kavindu-Dodan requested a review from a team as a code owner September 4, 2024 16:48
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 4, 2024
@Kavindu-Dodan Kavindu-Dodan added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Sep 4, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 4, 2024
@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/support-owning-account-in-metrics branch 3 times, most recently from 69c5245 to a5e9003 Compare September 6, 2024 14:29
@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/support-owning-account-in-metrics branch 3 times, most recently from 41b36f2 to 580d9ed Compare September 9, 2024 16:45
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

LGTM!

@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/support-owning-account-in-metrics branch from 580d9ed to b9ed778 Compare September 10, 2024 16:55
Copy link
Contributor

mergify bot commented Sep 11, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Sep 11, 2024
@v1v v1v removed the backport-v8.x label Sep 11, 2024
@Kavindu-Dodan Kavindu-Dodan removed the backport-skip Skip notification from the automated backport with mergify label Sep 12, 2024
@kaiyan-sheng
Copy link
Contributor

@elastic/elastic-agent-data-plane Could we get a review for this PR please? Thanks!!

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Kavindu-Dodan and others added 4 commits September 13, 2024 09:15
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/support-owning-account-in-metrics branch from b9ed778 to 104fdb7 Compare September 13, 2024 16:15
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Sep 16, 2024
Copy link
Collaborator

@pierrehilbert pierrehilbert left a comment

Choose a reason for hiding this comment

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

Approving for the Elastic Agent Data Plane part as this is only adding new configuration entries in the yml file.

@Kavindu-Dodan
Copy link
Contributor Author

Approving for the Elastic Agent Data Plane part as this is only adding new configuration entries in the yml file.

Thank you @pierrehilbert Yes, this adds owning_account option which works alongside include_linked_accounts property.

@Kavindu-Dodan Kavindu-Dodan merged commit 03e7699 into elastic:main Sep 17, 2024
29 checks passed
mergify bot pushed a commit that referenced this pull request Sep 17, 2024
* support OwniningAccount filtering

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* document the new paramter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* add changelog

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* Update CHANGELOG.next.asciidoc

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* Update x-pack/metricbeat/modules.d/aws.yml.disabled

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* add missing docuemntation of owning_account parameter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

---------

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit 03e7699)
@pierrehilbert
Copy link
Collaborator

I just remembered that you mentioned the target is 8.15.2: you should add the backport-8.15 label if this is the case.

@kaiyan-sheng kaiyan-sheng added the backport-8.15 Automated backport to the 8.15 branch with mergify label Sep 17, 2024
mergify bot pushed a commit that referenced this pull request Sep 17, 2024
* support OwniningAccount filtering

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* document the new paramter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* add changelog

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* Update CHANGELOG.next.asciidoc

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* Update x-pack/metricbeat/modules.d/aws.yml.disabled

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* add missing docuemntation of owning_account parameter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

---------

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit 03e7699)
Kavindu-Dodan added a commit that referenced this pull request Sep 17, 2024
…40860)

* support OwniningAccount filtering

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* document the new paramter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* add changelog

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* Update CHANGELOG.next.asciidoc

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* Update x-pack/metricbeat/modules.d/aws.yml.disabled

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* add missing docuemntation of owning_account parameter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

---------

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit 03e7699)

Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Kavindu-Dodan added a commit that referenced this pull request Sep 17, 2024
…t monitoring (#40864)

* [AWS] Support owning account for cross account monitoring (#40691)

* support OwniningAccount filtering

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* document the new paramter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* add changelog

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* Update CHANGELOG.next.asciidoc

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* Update x-pack/metricbeat/modules.d/aws.yml.disabled

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>

* add missing docuemntation of owning_account parameter

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

---------

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit 03e7699)

* Update CHANGELOG.next.asciidoc for the backport

---------

Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.15 Automated backport to the 8.15 branch with mergify enhancement Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AWS] Enable OwningAccount for cross account monitoring
5 participants