Skip to content

Conversation

@ycombinator
Copy link
Contributor

This PR teaches the elasticsearch/index_recovery metricset to index index_recovery documents into .monitoring-es-6-mb-* indices. These documents should be compatible in structure to index_recovery documents in the current .monitoring-es-6-* indices indexed via the internal monitoring method.

@ycombinator ycombinator added review Metricbeat Metricbeat needs_backport PR is waiting to be backported to other branches. v7.0.0-alpha1 monitoring v6.5.0 labels Aug 28, 2018
@ycombinator ycombinator requested a review from ruflin August 28, 2018 01:01
// specific language governing permissions and limitations
// under the License.

package index_recovery

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

ActiveOnly bool `config:"index_recovery.active_only"`
}{
ActiveOnly: true,
ActiveOnly: false,
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 made this change to be consistent with the current default value in XPack Monitoring:

https://github.com/elastic/elasticsearch/blob/ed0571e16caac689a77362bfe4c45c79dcba4d82/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryCollector.java#L41-L45

However, it means that even for the non-xpack-monitoring case we will collect all index recoveries, not just active ones. WDYT of that?

Copy link
Contributor Author

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.

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.

Code overall looks good to me. Some minor comments.


"github.com/elastic/beats/metricbeat/helper/elastic"
"github.com/elastic/beats/metricbeat/module/elasticsearch"

Copy link
Contributor

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 {
Copy link
Contributor

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"]
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@ycombinator
Copy link
Contributor Author

@ruflin Addressed all feedback from last review. Ready for your 👀 again. Thanks!

@ruflin
Copy link
Contributor

ruflin commented Aug 29, 2018

jenkins, test this

@ycombinator ycombinator merged commit f6b3e78 into elastic:master Aug 29, 2018
@ycombinator ycombinator added v6.5.0 and removed needs_backport PR is waiting to be backported to other branches. labels Aug 29, 2018
@ycombinator ycombinator deleted the metricbeat/elasticsearch/index-recovery/x-pack branch August 29, 2018 15:02
@ycombinator ycombinator added needs_backport PR is waiting to be backported to other branches. and removed needs_backport PR is waiting to be backported to other branches. labels Sep 5, 2018
ycombinator added a commit that referenced this pull request Sep 7, 2018
* Adding index_recovery xpack monitoring documents

* Get all recoveries if xpack.enabled is true

* Removing newline (which also reordered imports)

* Don't reuse value so much

(cherry picked from commit f6b3e78)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants