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] Migrate Kubernetes state_statefulset Metricset to use ReporterV2 interface #10976

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Feb 27, 2019

Refer to #10774 for more info

@sayden sayden added Metricbeat Metricbeat Team:Integrations Label for the Integrations team labels Feb 27, 2019
@sayden sayden self-assigned this Feb 27, 2019
@sayden sayden requested a review from a team as a code owner February 27, 2019 19:55
@sayden sayden changed the title [Metricbeat] Migrate Kubernetes state_node Metricset to use ReporterV2 interface [Metricbeat] Migrate Kubernetes state_statefulset Metricset to use ReporterV2 interface Feb 27, 2019
@sayden
Copy link
Contributor Author

sayden commented Feb 28, 2019

jenkins, test this

@sayden sayden force-pushed the migration/mb/reporterv2/kubernetes/state_statefulset branch from d400c9e to f04c535 Compare March 1, 2019 11:54
ruflin
ruflin previously approved these changes Mar 6, 2019
@sayden sayden dismissed ruflin’s stale review March 8, 2019 10:00

Won't merge this yet until I test properly the "namespace issue"

@sayden sayden added in progress Pull request is currently in progress. and removed review labels Mar 8, 2019
@sayden sayden force-pushed the migration/mb/reporterv2/kubernetes/state_statefulset branch from f04c535 to b526aac Compare March 13, 2019 11:00
@sayden sayden requested a review from a team as a code owner March 13, 2019 11:00
@sayden sayden added review and removed in progress Pull request is currently in progress. labels Mar 13, 2019
},
"kubernetes": {
"statefulset": {
"_module": {
Copy link
Member

Choose a reason for hiding this comment

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

If I read the code correct, fields under _module should go on the module level. This means this would become kubernetes.namespace: default. This would also align well with https://github.com/elastic/beats/blob/master/libbeat/processors/add_kubernetes_metadata/_meta/fields.yml#L21

Please double check with data you receive when running 6.6. The same applies to all the other modules which use this labels magic.

@@ -50,10 +49,6 @@ var (
"statefulset": p.KeyLabel("name"),
"namespace": p.KeyLabel(mb.ModuleDataKey + ".namespace"),
Copy link
Member

Choose a reason for hiding this comment

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

Here is the magic I mentioned above. The part I don't know how you can access this label data below. You probably have to fetch it and delete the key and we change the "framework" later?

"host": "192.168.99.100:18080",
"module": "kubernetes",
"name": "state_statefulset",
"namespace": "statefulset",
Copy link
Member

Choose a reason for hiding this comment

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

@exekias We seem to loose this field here but I would argue it's not an issue. WDYT?

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 the kubernetes namespace? that field would be needed to identify the statefulset we are referring to

Copy link
Contributor

Choose a reason for hiding this comment

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

nevermind, I see this is a different namespace, we can drop it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You'll see this "dropping field" pattern in more metricsets in Kubernetes. Just to give you some context @exekias the main idea was to achieve the migration, even dropping few things that weren't critical. In this case I have to admit that I was getting confused with the namespace thing (it seems there are 2 namespaces, the one of kubernetes and the other 😄 ) but I'd need to change quite a lot of code to test the module fields and the root fields (current code only tests metricset fields)

So, now that we have the new testing framework of @ruflin it seemed like the way to go and maybe delete current testing code if it doesn't achieve much more than what we get with the contents of testdata folder.

I know it seems confusing so just ping me if you need a longer explanation 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I got it, I'm ok with the change 👍

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

LGTM

@sayden sayden force-pushed the migration/mb/reporterv2/kubernetes/state_statefulset branch from d86a997 to cf20619 Compare April 2, 2019 12:50
@ruflin
Copy link
Member

ruflin commented Apr 3, 2019

jenkins, test this

@sayden
Copy link
Contributor Author

sayden commented Apr 4, 2019

Error seems unrelated. Merging

@sayden sayden merged commit 9df6455 into elastic:master Apr 4, 2019
@zube zube bot removed the [zube]: In Progress label Apr 4, 2019
@zube zube bot added the [zube]: Done label Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants