Expose opt-in Mako Prometheus metrics - #14040
mengxu-oai wants to merge 2 commits into
Conversation
saintstack
left a comment
There was a problem hiding this comment.
mako is distinct but was wondering why not use existing fdb otel or statsd? Why add 3rd model, and one that is pull based rather than push (is pull good for mako stats when runs are short).
We also include a minimal http server here. You might make the argument for it (I think its easy -- smile) otherwise folks will wonder why codebase has a second one apart from fdbrpc/HTTPServer.cpp.
Thanks.
| } | ||
| switch (c) { | ||
| case '?': | ||
| return -2; |
There was a problem hiding this comment.
should print help msg by usage(); before return -2.
Hi @saintstack , The problem we want to solve is to run a distributed Mako workload against an FDB cluster to do the load testing and release performance testing. A single box Mako workload is not enough to drive enough workload against a FDB cluster, so we need multiple mako instances (on k8s) driving load against a FDB cluster. We want to measure the client-side performance, including P50 and P99 latency of GET and update requests and the QPS, IOPS throughput metrics. That's why we want to expose the metrics from each micro instance and leverage Grafana to create the stats and client-side performance dashboard. regarding FDB StatsD and OTEL, reasons are:
I'm open to suggestions. |
saintstack
left a comment
There was a problem hiding this comment.
LGTM
Will review when you move it out of draft mode.
Thanks.
Thank you! @saintstack i marked it ready. |
|
Was looking at the http server again. No keep-alive, no chunking, no pipelining but I think its fine. One suggestion given you have it is to use more of boost beast: you can delete request.rfind("GET /metrics HTTP/1.", 0) == 0 and you get stuff like absolute-form URI, and leading-CRLF tolerance for the same LoC. beast::tcp_stream::expires_after gives you the read timeout in one line. Suggestions from my 'friend' given you are doing the raw asio are:
I was asking my friend about the standalone, hand-written http server and it was more concerned about prometheus.hpp + native_latency.hpp with hand-rolled format and a 250-bucket cumulative histogram with hand-strided index math (for (int index = 426; index <= 1278; index += 4)). I looked at having mako just dump a file and let something like a telegraf host it but more work. Sorry for all the comments. Am interested in this project. Would be good to have something like it back in core fdb on each process: e.g. different context completely but just FYI #12680. |
|
From local LLM. See what you think:
|
Mako currently reports live throughput to stdout and sampled latency only through process-private data, so a workload scraper cannot read client-side throughput and latency during a run. Add opt-in
--prometheus_port=PORT(disabled by default) to serve/metricsfrom Mako's stats process. Per-worker shared-memory atomics expose completed and attempted transactions, GET/UPDATE client API steps, commits, conflicts, errors, timeouts, and estimated logical bytes. A bounded cumulative histogram exports successful sampled GET and COMMIT latency in seconds for Prometheusrateandhistogram_quantile. The endpoint also reports configured workers, sampling, and job/workload labels; stdout interval latency JSON is removed.The exporter allocates shared histogram/counter storage only when enabled. Roughly 250 finite latency buckets per operation provide about 4.4% width from 100 µs through 1 s; production dashboards should scope by pod and account for this series count.
Validation: focused CTest covers cross-process aggregation, cumulative histogram bounds, HTTP 200/404, and occupied-port failure; changed Mako and async translation units compile, clang-format dry-run and whitespace checks pass.