-
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
Conversation
Can one of the admins verify this patch? |
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.
Thank you for your contribution! 🎉 I made some comments on fields.yml, also feel free to add a changelog line :)
description: > | ||
node depth | ||
- name: exists | ||
type: long |
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.
this could be a boolean
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.
hi, I have update the fields.yml and the changelog.
description: > | ||
osd or bucket node id | ||
- name: name | ||
type: string |
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.
This can either be keyword
or text
. You want to use keyword
on fields like this, with a limited number of possible values, and text
for free form strings
Is there any way for me to change the modules.d/ceph.yaml.disabled file, and add "osd_tree" as one of the monitor options like this: |
Yes, modify metricbeat/module/ceph/_meta/config.yml then run |
@exekias fileds.yml has been update, please check~ |
metricbeat/docs/fields.asciidoc
Outdated
[float] | ||
=== `ceph.osd_tree.children` | ||
|
||
type: string |
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.
metricbeat/docs/fields.asciidoc
Outdated
[float] | ||
=== `ceph.osd_tree.father` | ||
|
||
type: string |
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.
looks like 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.
father is the parent node's name, it could be keyword, I will fix it.
metricbeat/docs/fields.asciidoc
Outdated
[float] | ||
=== `ceph.osd_tree.status` | ||
|
||
type: string |
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.
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.
yes, it is, I will fix it.
@@ -0,0 +1,88 @@ | |||
package osd_tree |
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.
don't use an underscore in package name
@@ -0,0 +1,48 @@ | |||
package osd_tree |
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.
don't use an underscore in package name
}, nil | ||
} | ||
|
||
func (m *MetricSet) Fetch() ([]common.MapStr, error) { |
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.
exported method MetricSet.Fetch should have comment or be unexported
*helper.HTTP | ||
} | ||
|
||
func New(base mb.BaseMetricSet) (mb.MetricSet, error) { |
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.
exported function New should have comment or be unexported
} | ||
} | ||
|
||
type MetricSet struct { |
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.
exported type MetricSet should have comment or be unexported
DeviceClass string `json:"device_class"` | ||
} | ||
|
||
type Output struct { |
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.
exported type Output should have comment or be unexported
Id int64 `json:"id"` | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
TypeId int64 `json:"type_id"` |
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.
struct field TypeId should be TypeID
) | ||
|
||
type Node struct { | ||
Id int64 `json:"id"` |
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.
struct field Id should be ID
"github.com/elastic/beats/libbeat/logp" | ||
) | ||
|
||
type Node struct { |
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.
exported type Node should have comment or be unexported
@@ -0,0 +1,99 @@ | |||
package osd_tree |
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.
don't use an underscore in package name
We just enabled hound, please don't take everything it says as mandatory, we are still testing the platform |
ok, I will just update "Id" to "ID", seems it looks much more unified. |
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.
Waiting for green
Thank you again! you rock 🎉 |
This PR is trying to collect the osd tree infomation of a ceph cluster. The osd tree infomation is important for understanding and monitoring the structure of a ceph cluster.
In this PR, the code will collect all the osd nodes' weight, status, primary_affinity and other usefull info.