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

[Metricbeat] Add tags for aws ec2 #12372

Merged
merged 8 commits into from
Jun 17, 2019
Merged

[Metricbeat] Add tags for aws ec2 #12372

merged 8 commits into from
Jun 17, 2019

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented May 30, 2019

This pr is to add tags into metrics from aws module for ec2.
For ec2, tags are already returned from DescribeInstances api call. With this change, tags will be a part of the metrics reported by ec2 metricset:

    "aws": {
        "ec2": {
            "cpu": {
                "total": {
                    "pct": 0.7000000000116418
                }
            },
            "instance": {
                "core": {
                    "count": 1
                },
                "image": {
                    "id": "ami-62d35c02"
                },
                "monitoring": {
                    "state": "enabled"
                },
            }
        },
        "tags": {
            "Name": "service-node",
            "aws:autoscaling:groupName": "service-asg"
        }
    },

How to test it?

Start an AWS EC2 instance and add tags for it. Then after this instance is in running state, start metricbeat aws module with ec2 metricset enabled. Then you should be able to see tags being collected and stored under aws.tags.*.

@kaiyan-sheng kaiyan-sheng self-assigned this May 30, 2019
@kaiyan-sheng kaiyan-sheng added Team:Integrations Label for the Integrations team [zube]: In Progress labels May 31, 2019
@kaiyan-sheng kaiyan-sheng marked this pull request as ready for review June 1, 2019 13:42
@kaiyan-sheng kaiyan-sheng requested review from a team as code owners June 1, 2019 13:42
@kaiyan-sheng
Copy link
Contributor Author

I might found some other useful apis to do this. Will put this PR under in progress till I find more information.

@kaiyan-sheng
Copy link
Contributor Author

I will keep this PR open for a little bit because the code added into ec2, s3 and sqs can still be used. There is no need to all call function GetResourcesTags in utils.go from #12480 when tag information is already obtained. For example, for ec2 metricset, DescribeInstances response already includes tags.

@kaiyan-sheng kaiyan-sheng changed the title [Metricbeat] Add ability to collect tags for aws services [Metricbeat] Add tags for aws ec2 Jun 11, 2019
@kaiyan-sheng kaiyan-sheng added review and removed [zube]: In Progress in progress Pull request is currently in progress. labels Jun 11, 2019
CHANGELOG.next.asciidoc Outdated Show resolved Hide resolved
@kaiyan-sheng kaiyan-sheng merged commit 8707c9b into elastic:master Jun 17, 2019
@kaiyan-sheng kaiyan-sheng deleted the collect_tags branch June 17, 2019 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants