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_deployment Metricset to use ReporterV2 interface #10961

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 13:23
@sayden
Copy link
Contributor Author

sayden commented Mar 1, 2019

@sayden sayden added the review label Mar 1, 2019
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Please check if final events are being correctly namespaced, having an update data.json will help.

@jsoriano jsoriano changed the title [Metricbeat] Migrate Kubernetes container Metricset to use ReporterV2 interface [Metricbeat] Migrate Kubernetes state_deployment Metricset to use ReporterV2 interface Mar 1, 2019
@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_deployment branch from f4834cf to 5b34853 Compare March 13, 2019 10:36
@sayden sayden requested a review from a team as a code owner March 13, 2019 10:44
@sayden
Copy link
Contributor Author

sayden commented Mar 13, 2019

jenkins, test this

@sayden
Copy link
Contributor Author

sayden commented Mar 13, 2019

@ruflin I'm missing something in this PR to generate the expected file with the new testing framework 😭

Nevermind: I placed test data in the wrong folder 😄

@sayden
Copy link
Contributor Author

sayden commented Mar 13, 2019

Error is related. Checking

@sayden sayden force-pushed the migration/mb/reporterv2/kubernetes/state_deployment branch from 12c0f36 to 485d0a6 Compare April 1, 2019 19:59
@@ -219,7 +219,7 @@ func checkDocumented(t *testing.T, data []common.MapStr) {
if _, ok := keys[prefix+".*"]; ok {
continue
}
t.Fatalf("key missing: %s", k)
t.Fatalf("check if fields are documented error: key missing '%s'", k)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruflin I added this because the original message did not show very clearly what was failing and it took me a while to figure out (until I checked the error line in fact). I hope this is ok :)

Copy link
Contributor

@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.

@exekias Could you also have a look if the events still look as expected. Please ping me if you need an update on the new test framework and what we changed.

@@ -132,5 +123,23 @@ func testCases() map[string]map[string]interface{} {
"replicas.unavailable": 0,
"replicas.updated": 1,
},
"jenkins@wise-lynx-jenkins": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also had to add this two "expected" events that were missing when running tests. I don't understand how they weren't failing before 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

The fields exist in the test file so I assume it's correct 🤞

@sayden sayden added review and removed in progress Pull request is currently in progress. labels Apr 2, 2019
@sayden sayden requested a review from exekias April 2, 2019 14:14
@sayden
Copy link
Contributor Author

sayden commented Apr 2, 2019

I have added @exekias to review. Forgive me @exekias ! 😄 I think you have more knowledge about this module than any of us and this PR has been the "inspiration" to push the rest of the metricsets.

@exekias
Copy link
Contributor

exekias commented Apr 2, 2019

this may need a changelog entry?

@exekias
Copy link
Contributor

exekias commented Apr 2, 2019

I have added @exekias to review. Forgive me @exekias ! I think you have more knowledge about this module than any of us and this PR has been the "inspiration" to push the rest of the metricsets.

great work on bringing the module to the V2 API!


assert.Equal(t, 5, len(events), "Wrong number of returned events")

testCases := testCases()
for _, event := range events {
name, err := event.GetValue("name")
metricsetFields := event.MetricSetFields
name, err := metricsetFields.GetValue("name")
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, do we need to deal with when err != nil here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was originally like this so I prefer to leave it

Copy link
Contributor

@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

@exekias I don't think we need a changelog as it does not have any affect on the user.

@@ -132,5 +123,23 @@ func testCases() map[string]map[string]interface{} {
"replicas.unavailable": 0,
"replicas.updated": 1,
},
"jenkins@wise-lynx-jenkins": {
Copy link
Contributor

Choose a reason for hiding this comment

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

The fields exist in the test file so I assume it's correct 🤞

@sayden sayden merged commit 8de672e into elastic:master Apr 3, 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.

5 participants