Skip to content

Add basic index recovery metricset#7225

Merged
ycombinator merged 7 commits intoelastic:masterfrom
ruflin:index-recovery
Jul 14, 2018
Merged

Add basic index recovery metricset#7225
ycombinator merged 7 commits intoelastic:masterfrom
ruflin:index-recovery

Conversation

@ruflin
Copy link
Copy Markdown
Contributor

@ruflin ruflin commented May 31, 2018

Add basic metricset for index recovery. By default only data about indices is fetched that are currently recovering.

Further changes:

  • Fix NO_COMPOSE flag for Golang integration tests
  • Clean up elasticsearch.GetInfo to also use fetchPath function
  • Enhance testing to also support settings metricset configs.

@ruflin ruflin added in progress Pull request is currently in progress. module Metricbeat Metricbeat labels May 31, 2018
Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

@ruflin ruflin force-pushed the index-recovery branch 2 times, most recently from 0173924 to 6de0631 Compare July 10, 2018 07:49
@ruflin ruflin added review and removed in progress Pull request is currently in progress. labels Jul 10, 2018
@ruflin ruflin force-pushed the index-recovery branch 2 times, most recently from 52e9a1d to e82ad36 Compare July 10, 2018 11:56
@ruflin ruflin changed the title add basic index recovery metricset Add basic index recovery metricset Jul 10, 2018
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

err is not used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added an if err check and send an the error event. I wonder if this is the right thing to do here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I now skiped the error completely. I initially reported it as an event. The good thing about it is that I detected a problem I had in the schema. The bad thing was that now instead of in the logs the user would have tons of documents in his index with errors which I think is not good.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we could log the errors instead of sending them, or collect them in a multierror and send them all together as an only event.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would we want to explicitely check if shards exists?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wouldn't add more variables to this template, for this kind of settings, the extra option is used In system and munin modules, this could be also used here (or we could also rename the extra to metricset_options if this is the use case for extra as it seems to be used for similar things).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed, didn't reliase extra is there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is recoveryPath used to check master state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The full url must be passed as this is the url that is revert to afterwards again. If not passed parts of the path will go missing. This is because of a hack to reuse the http client.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be shard_id?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kind of, see my comment in the code: https://github.com/elastic/beats/pull/7225/files#diff-d198e8deee0000763245926eefe134eaR32

TBH I'm still struggling a bit with what shard.id is as I would expect it to be a unique identifier but it's a counting integer related to an index as far as I can see.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about other fields such as translog.*, start_time, stop_time, etc.? Are you planning on adding them later?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Add them later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, later

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe I'm missing something but at first glance it looks like info isn't actually being used here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right, I added it out of habit as the plan is to add the xpack part where it will be need I think. Should I remove it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, my preference would be to remove it until we need it. Otherwise it might be confusing as to why it's there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, removed and new version pushed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See my other comment about info not being used.

ruflin added 7 commits July 13, 2018 15:48
Add basic metricset for index recovery. By default only data about indices is fetched that are currently recovering.

Further changes:

* Fix `NO_COMPOSE` flag for Golang integration tests
* Clean up elasticsearch.GetInfo to also use `fetchPath` function
* Enhance testing to also support settings metricset configs.
@ycombinator ycombinator merged commit 14888de into elastic:master Jul 14, 2018
@ruflin ruflin deleted the index-recovery branch July 20, 2018 13:47
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.

4 participants