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

Prospector and Harvester Cleanup #1144

Merged
merged 1 commit into from
Mar 18, 2016
Merged

Conversation

ruflin
Copy link
Contributor

@ruflin ruflin commented Mar 14, 2016

This PR simplifies #964 by already applying the non related parts.

  • Remove unnecessary for loop in readline
  • Introduce uuid for harvester to be able to uniquely track and identify harvesters in the future

"github.com/elastic/beats/filebeat/config"
"github.com/elastic/beats/filebeat/harvester/encoding"
"github.com/elastic/beats/filebeat/input"
)

type Harvester struct {
Id uuid.UUID
Copy link
Member

Choose a reason for hiding this comment

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

Why does a havester need a UUID? As far as I can tell, this value is transient, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal is to be able to track harvesters and also properly shut them down. So in case an error appears it is possible to better tell which harvester had problems. This is related to the PR here: https://github.com/elastic/beats/pull/964/files#diff-72613c7cf09182c67339cf99ed741eccR25

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The UUID only exists for the lifetime of a harvester.

Copy link
Member

Choose a reason for hiding this comment

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

If we need a ID to track an ephemeral harvester then why not just just assign ID's based on one up counter? There's no requirement for global uniqueness here as far as I can tell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would also work, but we the would need a central place to generate the ids for all harvester. UUID is convenient as I don't have to think about all this. Is there a disadvantage to using a UUID 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.

If we write the Id to logs and to stats, it is somehow persisted. Assuming logs and stats are stored in ES, it will make finding a specific harvester easier if we go with UUID I think as only one filter has to be applied. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

If the haverster ID is {{beat.UUID}}-hv{{havester ID}} then you can find logs and stats associated with a specific harvester, and you can also implicitly associate those logs and stats to the specific beat without having to maintain a mapping of havester ID to owning beat UUID.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The thing I don't like about the above is that currently beat.UUID is not accessible from the harvester. Perhaps it is easier to remove the UUID addition from this PR and continue the discussion in #964 (where it is coming from initially) as there it in more context?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think it makes sense to introduce the Havester ID in #964. We can discuss more there. If we need the beat UUID we can (preferable) inject it or have a singleton that makes it available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andrewkroh UUID removed.

This PR simplifies elastic#964 by already applying the non related parts.

* Remove unnecessary for loop in readline
andrewkroh added a commit that referenced this pull request Mar 18, 2016
Prospector and Harvester Cleanup
@andrewkroh andrewkroh merged commit 12fd5f9 into elastic:master Mar 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants