feat(prometheus): add Clouseau, DB count, IOQ and Smoosh metrics#6065
Conversation
| end. | ||
|
|
||
| get_ioq_stats() -> | ||
| IOQData = ioq:get_disk_queues(), |
There was a problem hiding this comment.
function does not exist in couchdb's ioq implementation.
Oddly, https://github.com/apache/couchdb-ioq is where the "real" IOQ is (the one Cloudant uses and maintains) but it is not in use by couchdb.
Perhaps now is the time to fix that.
There was a problem hiding this comment.
Since switching over is a bit more effort, I went ahead and updated the PR to support both IOQ implementations for now. Hope that's alright.
There was a problem hiding this comment.
One issue with this ioq is it's almost too wide spreading N queues over N schedulers that it effectively becomes a bypass. Ideally we'd have a little bit of a queue to do the prioritization against. Maybe we could some kind of a configurable limit or middle ground have 8 or 16 IO queues even if we have 80 schedulers...
There was a problem hiding this comment.
Thanks for the contribution, Sam!
Looks good overall the main thing we'd have to fix is the lack of ioq settings and the missing call in Apache CouchDB. You're using the alternative IOQ implementation https://github.com/apache/couchdb-ioq with multiple channels and the ioq:get_disk_queues() call. That function is not present in the built-in Apache CouchDB ioq.
The lack of ioq:get_disk_queues() is why the CI fails right off the bat. The xref CI step detects the unknown function call.
So, we'd have to make your PR work with both the built-in IOQ and the fancier one https://github.com/apache/couchdb-ioq. That could be done by adding a proxy ioq:get_disk_queues() function to ioq.erl and make it call get_queue_lengths(). Then we'd have to add the channels from get_queue_lengths() in the built-in ioq to the metrics. CouchDB users will want to see those most of all. That's just background vs interactive so add those to the prometheus metrics and in the tests for it.
If you add the proxy ioq:get_disk_queues() we can also clean up the xref exceptions in https://github.com/apache/couchdb/blob/main/test/fixtures/allowed-xref.txt
1:src/ioq.erl: Warning: ioq:get_disk_queues/0 is undefined function (Xref)
2:src/weatherreport_check_ioq.erl:{95,1}: Warning: weatherreport_check_ioq:check_legacy_int/1 calls undefined function ioq:get_disk_queues/0 (Xref)
| to_prom(ioq_channel_requests, gauge, "IOQ channel requests", ChannelRequests), | ||
| to_prom(ioq_total_requests, gauge, "IOQ total active requests", TotalRequests) | ||
| ]. | ||
| case IOQData of |
There was a problem hiding this comment.
Oops, I hadn't realized they actually return different data types maps vs kv lists. Instead of having to add handlers for both on every call let's instead make get_disk_queues() return a kv list. It would be as simple as passing it through maps:to_list(Map). For example:
> maps:to_list(#{a=>1}).
[{a,1}]e68152a to
321314d
Compare
Expose new Prometheus metrics for monitoring: - Clouseau search connectivity status - Total database count in cluster - IOQ active channels and request counts - Smoosh compaction job statistics (active/starting/waiting) Improves observability of core CouchDB subsystems.
321314d to
e2af307
Compare
Overview
Expose new Prometheus metrics for monitoring:
Improves observability of core CouchDB subsystems.
Testing recommendations
Example
Checklist
rel/overlay/etc/default.inisrc/docsfolder