Skip to content

Commit

Permalink
[kibana] pass unique service.address value (elastic#37178)
Browse files Browse the repository at this point in the history
* unique service.address

* fix stats metricset
  • Loading branch information
klacabane authored and Scholar-Li committed Feb 5, 2024
1 parent 32531c7 commit 6d9d12d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion metricbeat/module/kibana/cluster_actions/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ func eventMapping(r mb.ReporterV2, content []byte, isXpack bool) error {
RootFields: mapstr.M{
"service.id": serviceId,
"service.version": version,
"service.address": serviceAddress,
},
MetricSetFields: actionsFields,
Host: fmt.Sprintf("%v", serviceAddress),
}

// xpack.enabled in config using standalone metricbeat writes to `.monitoring` instead of `metricbeat-*`
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kibana/cluster_rules/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ func eventMapping(r mb.ReporterV2, content []byte, isXpack bool) error {
RootFields: mapstr.M{
"service.id": serviceId,
"service.version": version,
"service.address": serviceAddress,
},
MetricSetFields: rulesFields,
Host: fmt.Sprintf("%v", serviceAddress),
}

// xpack.enabled in config using standalone metricbeat writes to `.monitoring` instead of `metricbeat-*`
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kibana/node_actions/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ func eventMapping(r mb.ReporterV2, content []byte, isXpack bool) error {
RootFields: mapstr.M{
"service.id": serviceId,
"service.version": version,
"service.address": serviceAddress,
},
MetricSetFields: actionsFields,
Host: fmt.Sprintf("%v", serviceAddress),
}

// xpack.enabled in config using standalone metricbeat writes to `.monitoring` instead of `metricbeat-*`
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kibana/node_rules/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ func eventMapping(r mb.ReporterV2, content []byte, isXpack bool) error {
RootFields: mapstr.M{
"service.id": serviceId,
"service.version": version,
"service.address": serviceAddress,
},
MetricSetFields: rulesFields,
Host: fmt.Sprintf("%v", serviceAddress),
}

// xpack.enabled in config using standalone metricbeat writes to `.monitoring` instead of `metricbeat-*`
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/kibana/stats/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func eventMapping(r mb.ReporterV2, content []byte, isXpack bool) error {
return event.Error
}
_, _ = event.RootFields.Put("service.address", serviceAddress)
event.Host = fmt.Sprintf("%v", serviceAddress)

// Set process PID
process, ok := data["process"].(map[string]interface{})
Expand Down

0 comments on commit 6d9d12d

Please sign in to comment.