Skip to content

[AWS] Add include_linked_accounts parameter for all metrics data streams #6459

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 7 commits into from
Jun 9, 2023

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Jun 3, 2023

What does this PR do?

This PR is to add include_linked_accounts config parameter into all metrics data streams. This parameter is added into Metricbeat in elastic/beats#35648.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Screenshots

Default looks like this:
Screenshot 2023-06-07 at 11 27 38 AM

Config Include Linked Accounts is default to false for now.

Screenshot 2023-06-07 at 11 30 32 AM

With the Include Linked Accounts toggle enabled, the agent policy looks like this:

inputs:
  - id: aws/metrics-ec2-abc724c0-0558-11ee-bd26-592a7049951d
    name: aws-1
    revision: 2
    type: aws/metrics
    use_output: default
    meta:
      package:
        name: aws
        version: 1.41.0
    data_stream:
      namespace: default
    package_policy_id: abc724c0-0558-11ee-bd26-592a7049951d
    streams:
      - id: aws/metrics-aws.ec2_metrics-abc724c0-0558-11ee-bd26-592a7049951d
        data_stream:
          dataset: aws.ec2_metrics
          type: metrics
        access_key_id: foo
        period: 5m
        tags_filter: null
        metricsets:
          - cloudwatch
        secret_access_key: boo
        include_linked_accounts: true
        metrics:
          - name:
              - CPUUtilization
              - CPUCreditUsage
              - CPUCreditBalance
              - CPUSurplusCreditBalance
              - CPUSurplusCreditsCharged
              - StatusCheckFailed
              - StatusCheckFailed_Instance
              - StatusCheckFailed_System
            statistic:
              - Average
            namespace: AWS/EC2
            resource_type: 'ec2:instance'
          - name:
              - DiskReadBytes
              - DiskReadOps
              - DiskWriteBytes
              - DiskWriteOps
              - NetworkIn
              - NetworkPacketsIn
              - NetworkOut
              - NetworkPacketsOut
            statistic:
              - Sum
            namespace: AWS/EC2
            resource_type: 'ec2:instance'

I tested it with the config above and it does collect metrics from both monitoring account and linked source account:
Screenshot 2023-06-07 at 7 26 22 PM

@kaiyan-sheng kaiyan-sheng self-assigned this Jun 3, 2023
@kaiyan-sheng kaiyan-sheng requested a review from a team as a code owner June 3, 2023 03:47
@elasticmachine
Copy link

elasticmachine commented Jun 5, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-09T11:49:48.033+0000

  • Duration: 52 min 10 sec

Test stats 🧪

Test Results
Failed 0
Passed 190
Skipped 4
Total 194

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Jun 5, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (15/15) 💚
Files 93.75% (15/16) 👎 -6.25
Classes 93.75% (15/16) 👎 -6.25
Methods 85.921% (238/277) 👎 -12.71
Lines 85.925% (7387/8597) 👎 -8.431
Conditionals 100.0% (0/0) 💚

@kaiyan-sheng kaiyan-sheng requested review from zmoog and girodav June 6, 2023 17:36
@kaiyan-sheng kaiyan-sheng added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Jun 8, 2023
Copy link
Contributor

@zmoog zmoog left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@kaiyan-sheng kaiyan-sheng merged commit e234ffb into elastic:main Jun 9, 2023
@kaiyan-sheng kaiyan-sheng deleted the add_include_linked_accounts branch June 9, 2023 13:29
@elasticmachine
Copy link

Package aws - 1.43.0 containing this change is available at https://epr.elastic.co/search?package=aws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:aws AWS Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants