Skip to content

Commit

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

* fix stats metricset
  • Loading branch information
klacabane authored Nov 24, 2023
1 parent 07f6d5a commit a1627fc
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 a1627fc

Please sign in to comment.