Skip to content

Commit

Permalink
Add ceph osd tree infomation to metricbeat (#5498)
Browse files Browse the repository at this point in the history
Add osd_tree metricset
  • Loading branch information
elaron authored and exekias committed Nov 10, 2017
1 parent 16dffd3 commit 81bd9c6
Show file tree
Hide file tree
Showing 16 changed files with 584 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Add Kubernetes manifests to deploy Metricbeat. {pull}5349[5349]
- Add etcd module. {issue}4970[4970]
- Add ip address of docker containers to event. {pull}5379[5379]
- Add ceph osd tree infomation to metricbeat {pull}5498[5498]

*Packetbeat*

Expand Down
111 changes: 111 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,117 @@ type: long
Last updated
[float]
== osd_tree fields
ceph osd tree info
[float]
=== `ceph.osd_tree.id`
type: long
osd or bucket node id
[float]
=== `ceph.osd_tree.name`
type: text
osd or bucket node name
[float]
=== `ceph.osd_tree.type`
type: keyword
osd or bucket node type, illegal type include osd, host, root etc.
[float]
=== `ceph.osd_tree.type_id`
type: long
osd or bucket node typeID
[float]
=== `ceph.osd_tree.children`
type: text
bucket children list, seperate by comma.
[float]
=== `ceph.osd_tree.crush_weight`
type: float
osd node crush weight
[float]
=== `ceph.osd_tree.depth`
type: long
node depth
[float]
=== `ceph.osd_tree.exists`
type: boolean
is node still exist or not(1-yes, 0-no)
[float]
=== `ceph.osd_tree.primary_affinity`
type: float
the weight of reading data from primary osd
[float]
=== `ceph.osd_tree.reweight`
type: long
the reweight of osd
[float]
=== `ceph.osd_tree.status`
type: keyword
status of osd, it should be up or down
[float]
=== `ceph.osd_tree.device_class`
type: keyword
the device class of osd, like hdd, ssd etc.
[float]
=== `ceph.osd_tree.father`
type: keyword
the parent node of this osd or bucket node
[float]
== pool_disk fields
Expand Down
6 changes: 5 additions & 1 deletion metricbeat/docs/modules/ceph.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: ceph
metricsets: ["cluster_disk", "cluster_health", "monitor_health", "pool_disk"]
metricsets: ["cluster_disk", "cluster_health", "monitor_health", "pool_disk", "osd_tree"]
period: 10s
hosts: ["localhost:5000"]
----
Expand All @@ -39,6 +39,8 @@ The following metricsets are available:

* <<metricbeat-metricset-ceph-monitor_health,monitor_health>>

* <<metricbeat-metricset-ceph-osd_tree,osd_tree>>

* <<metricbeat-metricset-ceph-pool_disk,pool_disk>>

include::ceph/cluster_disk.asciidoc[]
Expand All @@ -49,5 +51,7 @@ include::ceph/cluster_status.asciidoc[]

include::ceph/monitor_health.asciidoc[]

include::ceph/osd_tree.asciidoc[]

include::ceph/pool_disk.asciidoc[]

19 changes: 19 additions & 0 deletions metricbeat/docs/modules/ceph/osd_tree.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-ceph-osd_tree]]
include::../../../module/ceph/osd_tree/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-ceph,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/ceph/osd_tree/_meta/data.json[]
----
1 change: 1 addition & 0 deletions metricbeat/include/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
_ "github.com/elastic/beats/metricbeat/module/ceph/cluster_health"
_ "github.com/elastic/beats/metricbeat/module/ceph/cluster_status"
_ "github.com/elastic/beats/metricbeat/module/ceph/monitor_health"
_ "github.com/elastic/beats/metricbeat/module/ceph/osd_tree"
_ "github.com/elastic/beats/metricbeat/module/ceph/pool_disk"
_ "github.com/elastic/beats/metricbeat/module/couchbase"
_ "github.com/elastic/beats/metricbeat/module/couchbase/bucket"
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ metricbeat.modules:

#-------------------------------- Ceph Module --------------------------------
- module: ceph
metricsets: ["cluster_disk", "cluster_health", "monitor_health", "pool_disk"]
metricsets: ["cluster_disk", "cluster_health", "monitor_health", "pool_disk", "osd_tree"]
period: 10s
hosts: ["localhost:5000"]

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/ceph/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- module: ceph
metricsets: ["cluster_disk", "cluster_health", "monitor_health", "pool_disk"]
metricsets: ["cluster_disk", "cluster_health", "monitor_health", "pool_disk", "osd_tree"]
period: 10s
hosts: ["localhost:5000"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"output": {
"nodes": [
{
"children": [
-3
],
"id": -1,
"name": "default",
"type": "root",
"type_id": 10
},
{
"children": [
1,
0
],
"id": -3,
"name": "ceph-mon1",
"pool_weights": {},
"type": "host",
"type_id": 1
},
{
"crush_weight": 0.048691,
"depth": 2,
"device_class": "hdd",
"exists": 1,
"id": 0,
"name": "osd.0",
"pool_weights": {},
"primary_affinity": 1.0,
"reweight": 1.0,
"status": "up",
"type": "osd",
"type_id": 0
},
{
"crush_weight": 0.048691,
"depth": 2,
"device_class": "hdd",
"exists": 1,
"id": 1,
"name": "osd.1",
"pool_weights": {},
"primary_affinity": 1.0,
"reweight": 1.0,
"status": "up",
"type": "osd",
"type_id": 0
}
],
"stray": []
},
"status": "OK"
}
35 changes: 35 additions & 0 deletions metricbeat/module/ceph/osd_tree/_meta/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"@timestamp": "2017-11-01T07:26:34.876Z",
"@metadata": {
"beat": "metricbeat",
"type": "doc",
"version": "7.0.0-alpha1"
},
"ceph": {
"osd_tree": {
"status": "up",
"name": "osd.0",
"type": "osd",
"primary_affinity": 1,
"exists": true,
"id": 0,
"type_id": 0,
"crush_weight": 0.048691,
"device_class": "hdd",
"reweight": 1,
"father": "ceph-mon1",
"depth": 2
}
},
"metricset": {
"rtt": 1331122,
"module": "ceph",
"name": "osd_tree",
"host": "192.168.56.131:5000"
},
"beat": {
"hostname": "centos7gui",
"version": "7.0.0-alpha1",
"name": "centos7gui"
}
}
3 changes: 3 additions & 0 deletions metricbeat/module/ceph/osd_tree/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
=== Ceph cluster_health metricset

This is the `osd_tree` metricset of the Ceph module.
57 changes: 57 additions & 0 deletions metricbeat/module/ceph/osd_tree/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
- name: osd_tree
type: group
description: >
ceph osd tree info
fields:
- name: id
type: long
description: >
osd or bucket node id
- name: name
type: text
description: >
osd or bucket node name
- name: type
type: keyword
description: >
osd or bucket node type, illegal type include osd, host, root etc.
- name: type_id
type: long
description: >
osd or bucket node typeID
- name: children
type: text
description: >
bucket children list, seperate by comma.
- name: crush_weight
type: float
description: >
osd node crush weight
- name: depth
type: long
description: >
node depth
- name: exists
type: boolean
description: >
is node still exist or not(1-yes, 0-no)
- name: primary_affinity
type: float
description: >
the weight of reading data from primary osd
- name: reweight
type: long
description: >
the reweight of osd
- name: status
type: keyword
description: >
status of osd, it should be up or down
- name: device_class
type: keyword
description: >
the device class of osd, like hdd, ssd etc.
- name: father
type: keyword
description: >
the parent node of this osd or bucket node
Loading

0 comments on commit 81bd9c6

Please sign in to comment.