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
[WIP] Implement CEPH OSD topology #75
Conversation
collectors/osd.go
Outdated
OSDExists: prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Namespace: cephNamespace, | ||
Name: "osd_exists", |
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.
Let's just name this osd_tree
. That way it will be easier to understand what it means. We can also add more labels to it in future if need be.
collectors/osd.go
Outdated
@@ -500,6 +533,79 @@ func (o *OSDCollector) collectOSDDump() error { | |||
|
|||
} | |||
|
|||
func (o *OSDCollector) collectOSDTree() 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.
Would it be possible to throw a quick test for collectOSDTree()
? There are examples in osd_test.go
which should help provide a sample.
... to simplify function calls in the recursive walker [ci skip]
99075ad
to
2de1cfe
Compare
2de1cfe
to
40433e5
Compare
I changed the approach to fetch the topology in the beginning of the run. Again comments are welcome to validate the approach before I ask for a merge. |
This PR adds a new metric called ceph_osd_exists which is computed from the ceph osd tree output.
This metric has a topology label which is composed of the tree topology (not sorted). This sort of implements the requirement from #40
The resulting metric is a bit messy at the moment and needs metric_relabel_configs on the prometheus side to be cleanly stored.
The idea behind this is to have a lookup metric we can use with the label_values function to extract templated variables for use by grafana.
Here is my job definition with an example metric_relabel_config:
I'm currently asking for some feedback on the approach thus the [WIP] in the name.