-
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
Add ceph osd tree infomation to metricbeat #5498
Changes from 5 commits
1f1aa1f
b6d4acd
386d48a
8582680
9d12170
e19e598
c1b10d0
292f106
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 |
---|---|---|
|
@@ -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: string | ||
|
||
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: string | ||
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. this should be keyword 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. yes, it is, I will fix it. |
||
|
||
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: string | ||
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. looks like this should be keyword 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. father is the parent node's name, it could be keyword, I will fix it. |
||
|
||
the parent node of this osd or bucket node | ||
|
||
|
||
[float] | ||
== pool_disk fields | ||
|
||
|
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[] | ||
---- |
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" | ||
} |
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" | ||
} | ||
} |
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. |
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: string | ||
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: string | ||
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: string | ||
description: > | ||
the parent node of this osd or bucket node |
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 think this should be keyword?
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.
Actually children is a list of children nodes, I don't think it is keyword type.
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.
How are children named? It should be either keyword or text. Have a look to ES documentation:https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html:
In Elasticsearch, there is no dedicated array type. Any field can contain zero or more values by default, however, all values in the array must be of the same datatype
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.
children list is a ID list seperated by comma, looks like:
"children": "4,3,1,0"
I think it's much more like text. I will change its type from string to text.
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.
ah thank you, I understand it now, would it make sense to split that string into an array of keywords?
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.
Actually I display this children list in Grafana as a text, seems like there's no need to make them into an array of keyword now. If there's a need to make them into array in the future, I will pull a patch for it.