-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Adding xpack code for ES index recovery metricset #8106
Adding xpack code for ES index recovery metricset #8106
Conversation
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package index_recovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use an underscore in package name
@@ -50,7 +50,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { | |||
config := struct { | |||
ActiveOnly bool `config:"index_recovery.active_only"` | |||
}{ | |||
ActiveOnly: true, | |||
ActiveOnly: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change to be consistent with the current default value in XPack Monitoring:
However, it means that even for the non-xpack-monitoring case we will collect all index recoveries, not just active ones. WDYT of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this comment, I was able to make this flag smarter in 4817f48.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code overall looks good to me. Some minor comments.
|
||
"github.com/elastic/beats/metricbeat/helper/elastic" | ||
"github.com/elastic/beats/metricbeat/module/elasticsearch" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove newline
continue | ||
} | ||
|
||
for _, value = range shards { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit worried that we reuse the name value
here.
continue | ||
} | ||
|
||
value, ok = indexData["shards"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason here that shards
etc. could be missing?
Also worried about reuse of value
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason here that shards etc. could be missing?
It should never happen. I was just being safe with the ok
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on the ok
check. Was mainly curious if in "normal" behaviour of the endpoint we expect this to happen. They way I understand your answer it's not the case.
@ruflin Addressed all feedback from last review. Ready for your 👀 again. Thanks! |
jenkins, test this |
This PR teaches the
elasticsearch/index_recovery
metricset to indexindex_recovery
documents into.monitoring-es-6-mb-*
indices. These documents should be compatible in structure toindex_recovery
documents in the current.monitoring-es-6-*
indices indexed via the internal monitoring method.