Skip to content

Commit

Permalink
Make elasticsearch/shard metricset work for Stack Monitoring without …
Browse files Browse the repository at this point in the history
…xpack.enabled flag (#21389)
  • Loading branch information
sayden authored Dec 15, 2020
1 parent 11f8738 commit 2c5742f
Show file tree
Hide file tree
Showing 12 changed files with 364 additions and 226 deletions.
52 changes: 52 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18134,6 +18134,43 @@ Elasticsearch module



*`shard.primary`*::
+
--
type: alias

alias to: elasticsearch.shard.primary

--

*`shard.state`*::
+
--
type: alias

alias to: elasticsearch.shard.state

--

*`shard.index`*::
+
--
type: alias

alias to: elasticsearch.index.name

--

*`shard.node`*::
+
--
type: alias

alias to: elasticsearch.node.name

--


*`cluster_state.nodes_hash`*::
+
--
Expand Down Expand Up @@ -22123,6 +22160,21 @@ type: keyword

--


*`elasticsearch.shard.source_node.name`*::
+
--
type: keyword

--

*`elasticsearch.shard.source_node.uuid`*::
+
--
type: keyword

--

[[exported-fields-envoyproxy]]
== Envoyproxy fields

Expand Down
15 changes: 15 additions & 0 deletions metricbeat/module/elasticsearch/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
settings: ["ssl", "http"]
short_config: false
fields:
- name: shard
type: group
fields:
- name: primary
type: alias
path: elasticsearch.shard.primary
- name: state
type: alias
path: elasticsearch.shard.state
- name: index
type: alias
path: elasticsearch.index.name
- name: node
type: alias
path: elasticsearch.node.name
- name: cluster_state
type: group
fields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ func TestXPackEnabled(t *testing.T) {
require.NoError(t, err)
require.Len(t, events, numShards)

for _, event := range events {
require.Equal(t, "shards", event.RootFields["type"])
require.Regexp(t, `^.monitoring-es-\d-mb`, event.Index)
}

return
}

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/elasticsearch/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions metricbeat/module/elasticsearch/shard/_meta/data-xpack.json

This file was deleted.

31 changes: 17 additions & 14 deletions metricbeat/module/elasticsearch/shard/_meta/data.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"beat": {
"hostname": "host.example.com",
"name": "host.example.com"
},
"elasticsearch": {
"cluster": {
"id": "91RpCx2xSQ21pVPTZfDK0Q",
"name": "elasticsearch",
"id": "tMjf3CQ_TyCXNfcoR9eTWw",
"name": "docker-cluster",
"state": {
"id": "MBE4XrQOSf6ScXRTuCO1Pw"
"id": "n-UoXaqYRoOe9qAC76IG6A"
}
},
"index": {
"name": "heartbeat-7.0.0-alpha1-2018.08.27"
"name": ".apm-agent-configuration"
},
"node": {
"name": "Z4hBonPxQVW9qPKEHpwWCg"
"name": "hx-oJ1-aT_-5pRG22JMI1Q"
},
"shard": {
"number": 0,
"primary": true,
"relocating_node": {
"name": null
},
"source_node": {
"name": "1fb2aa83efac",
"uuid": "hx-oJ1-aT_-5pRG22JMI1Q"
},
"state": "STARTED"
}
},
"event": {
"dataset": "elasticsearch.shard",
"duration": 115000,
"module": "elasticsearch"
},
"metricset": {
"host": "127.0.0.1:9200",
"module": "elasticsearch",
"name": "shard",
"namespace": "elasticsearch.shard",
"rtt": 115
"period": 10000
},
"service": {
"name": "elasticsearch"
"address": "127.0.0.1:41773",
"type": "elasticsearch"
}
}
7 changes: 7 additions & 0 deletions metricbeat/module/elasticsearch/shard/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@
type: keyword
description: >
The node the shard was relocated from.
- name: source_node
type: group
fields:
- name: name
type: keyword
- name: uuid
type: keyword
Loading

0 comments on commit 2c5742f

Please sign in to comment.