Skip to content
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

Merged
merged 8 commits into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,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: string
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.


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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be keyword

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this should be keyword

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

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: 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
Loading