-
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
Consistency in Elastic stack metricsets' code #8308
Changes from all commits
654c691
b81e68c
d31db81
da50d8b
a22bc35
4ab37c7
6818949
c580f27
9594363
3deed0b
45cab6a
451fa56
c40655f
e32d2b1
1e5c38d
2baf502
a847e4e
8701cb9
c3631b4
40f3406
acf6930
db6a2d2
12a4015
0befa82
a864b21
6b6bb3c
5291885
35447b1
3be2ae3
ab3a9ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,18 +68,23 @@ func eventsMapping(r mb.ReporterV2, info elasticsearch.Info, content []byte) err | |
var errs multierror.Errors | ||
for name, index := range indicesStruct.Indices { | ||
event := mb.Event{} | ||
event.MetricSetFields, err = schema.Apply(index) | ||
if err != nil { | ||
r.Error(err) | ||
errs = append(errs, errors.Wrap(err, "failure applying index schema")) | ||
} | ||
// Write name here as full name only available as key | ||
event.MetricSetFields["name"] = name | ||
|
||
event.RootFields = common.MapStr{} | ||
event.RootFields.Put("service.name", elasticsearch.ModuleName) | ||
|
||
event.ModuleFields = common.MapStr{} | ||
event.ModuleFields.Put("cluster.name", info.ClusterName) | ||
event.ModuleFields.Put("cluster.id", info.ClusterID) | ||
|
||
event.MetricSetFields, err = schema.Apply(index) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is now solved with the more resent commits? |
||
if err != nil { | ||
event.Error = errors.Wrap(err, "failure applying index schema") | ||
r.Event(event) | ||
errs = append(errs, event.Error) | ||
continue | ||
} | ||
// Write name here as full name only available as key | ||
event.MetricSetFields["name"] = name | ||
r.Event(event) | ||
} | ||
|
||
|
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.
I like that we report partial documents events even on failure. We should probably document this somewhere.