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

Move elasticsearch node_stats metricset under node.stats namespace #4142

Merged
merged 1 commit into from
May 9, 2017

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Apr 28, 2017

So far the node_stats was putting all its data under elasticsearch.node_stats.*. This was changed to elasticsearch.node.stats.*.

Further changes:

  • Remove support for setting index in metricset. This was never used and can now be done through using format string in the index setting.
  • Remove support for setting type in metricset. Type will be removed in elasticsearch.
  • Rename ModuleData constant to ModuleDataKey.
  • Introduce NamespaceKey as constant to replace hardcoded _namespace.
  • Cleanup event generation for metricbeat.
  • Remove type from event as not needed.

@@ -68,37 +59,32 @@ func (b EventBuilder) Build() (common.MapStr, error) {
if n, ok := event["_namespace"]; ok {
delete(event, "_namespace")
namespace = n.(string)
Copy link
Member

Choose a reason for hiding this comment

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

Just to be safe, this should check the boolean that is returned that indicates the success of the type assertion.

Copy link
Member Author

Choose a reason for hiding this comment

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

added

// In case meta data exists, it is added on the module level
// This is mostly used for shared fields across multiple metricsets in one module
if moudleDataExists {
if _, ok := moduleData.(common.MapStr); ok {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of ignoring the result of the type assertion with an assignment to _, we could use the value in the following expression instead of doing a second type assertion.

Copy link
Member Author

Choose a reason for hiding this comment

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

changed

@ruflin ruflin force-pushed the node.stats branch 3 times, most recently from d4ed150 to 5ba5dad Compare May 4, 2017 18:45
So far the node_stats was putting all its data under `elasticsearch.node_stats.*`. This was changed to `elasticsearch.node.stats.*`.

Further changes:

* Remove support for setting index in metricset. This was never used and can now be done through using format string in the index setting.
* Remove support for setting type in metricset. Type will be removed in elasticsearch.
* Rename ModuleData constant to ModuleDataKey.
* Introduce NamespaceKey as constant to replace hardcoded `_namespace`.
* Cleanup event generation for metricbeat.
* Remove `type` from event as not needed and remove it as required field.
@ruflin
Copy link
Member Author

ruflin commented May 9, 2017

jenkins, retest it

@andrewkroh andrewkroh merged commit 4ff772d into elastic:master May 9, 2017
@ruflin ruflin deleted the node.stats branch May 9, 2017 13:46
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