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

Index cluster.id and cluster.name in elasticsearch/ml_job metricset #9165

Merged
merged 2 commits into from
Nov 20, 2018
Merged

Index cluster.id and cluster.name in elasticsearch/ml_job metricset #9165

merged 2 commits into from
Nov 20, 2018

Conversation

ycombinator
Copy link
Contributor

This PR teaches the elasticsearch/ml_job metricset to index the Elasticsearch cluster_uuid and cluster_name as the module-level cluster.id and cluster.name fields, respectively.

@ycombinator ycombinator added review Metricbeat Metricbeat needs_backport PR is waiting to be backported to other branches. v7.0.0-alpha1 v6.6.0 labels Nov 20, 2018
@ycombinator ycombinator requested a review from ruflin November 20, 2018 04:13

// +build !integration

package ml_job

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

As mentioned in other PR's, worth adding a changelog I think.

General note: Right now the code is in each metricset which is ok. To simplify the code perhaps have something like

func enrichEvent(info elasticsearch.Info, event beat.Event) beat.Event { ... }

Like this it would be only 1 line in each metricset and if we decide to add more general fields in the future we can do it in one place. That is basically what I meant in the past with a "processor".

@ycombinator
Copy link
Contributor Author

As mentioned in other PR's, worth adding a changelog I think.

I think in general yes but these fields (cluster_uuid and cluster_name) were a miss. They should've been there to begin with because some other metricsets in this module have them but some don't.

I say we add CHANGELOG entries for new fields once the module goes GA?

... That is basically what I meant in the past with a "processor".

Ah yes, I totally forgot about this idea 🤦‍♂️. Will refactor all of these in a follow up PR!

@ycombinator ycombinator merged commit e7f4a1c into elastic:master Nov 20, 2018
@ycombinator ycombinator deleted the metricbeat-elasticsearch-ml-job-cluster-id-name branch November 20, 2018 13:40
@ycombinator ycombinator removed the needs_backport PR is waiting to be backported to other branches. label Nov 20, 2018
ycombinator added a commit that referenced this pull request Nov 21, 2018
…csearch/ml_job metricset (#9173)

* Index cluster.id and cluster.name in elasticsearch/ml_job metricset (#9165)

This PR teaches the `elasticsearch/ml_job` metricset to index the Elasticsearch `cluster_uuid` and `cluster_name` as the module-level `cluster.id` and `cluster.name` fields, respectively.

(cherry picked from commit e7f4a1c)

* Fixing field name for 6.x
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