-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
metricbeat/mb/module/event.go
Outdated
@@ -68,37 +59,32 @@ func (b EventBuilder) Build() (common.MapStr, error) { | |||
if n, ok := event["_namespace"]; ok { | |||
delete(event, "_namespace") | |||
namespace = n.(string) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
metricbeat/mb/module/event.go
Outdated
// 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
d4ed150
to
5ba5dad
Compare
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.
jenkins, retest it |
So far the node_stats was putting all its data under
elasticsearch.node_stats.*
. This was changed toelasticsearch.node.stats.*
.Further changes:
_namespace
.type
from event as not needed.