Repository navigation
docs: Prometheus metrics + generator - #5179
Conversation
Co-authored-by: Dean Sheather <dean@deansheather.com>
Co-authored-by: Dean Sheather <dean@deansheather.com>
Co-authored-by: Dean Sheather <dean@deansheather.com>
Co-authored-by: Dean Sheather <dean@deansheather.com>
Co-authored-by: Dean Sheather <dean@deansheather.com>
| coderd_api_concurrent_websockets 1 | ||
| # HELP coderd_api_request_latencies_ms Latency distribution of requests in milliseconds | ||
| # TYPE coderd_api_request_latencies_ms histogram | ||
| coderd_api_request_latencies_ms_bucket{method="GET",path="",le="1"} 10 |
There was a problem hiding this comment.
Wonder if we could get a cleaner dump here, the histogram seems to take up a lot of space, but it's just repeating different routes.
There was a problem hiding this comment.
Frankly speaking, the idea was to just dump it and forget about it. The format is not intended to be reviewed by humans. The generator makes sure that it can be cleaned and processed into the Markdown table.
Regarding the dumping process, I considered other options like booting up the coderd and fetching Prometheus metrics from http://localhost:2112, but you would have to run it in a container as process metrics are only available in Linux. Eventually, I decided to leave it to the developer to just use curl and update the file.
If you have any ideas on how to improve it, I'm happy to change the concept.
There was a problem hiding this comment.
What if instead of storing the dump in the repo you made the script directly connect to the server and download the prom metrics? Would probably need to be moved out of make gen as it would be prone to failure if not configured properly.
There was a problem hiding this comment.
As I said before, in this case, the coder server must be started in the container, so it can also run the process stats collector (Linux only). I'm looking into fully reproducible options.
Most likely, the script would have to simulate some actions, start the workspace, provision something, etc. to collect as many metrics as possible.
Long story short, this method isn't perfect too.
EDIT:
Unless you're thinking about detaching the script from make gen totally, but I guess that the idea of having a container might be worth considering here as well.
|
I've just re-requested reviews. Kindly please to take another look and if it's ok, please 👍 . |
Fixes: #3520
Preview: https://github.com/mtojek/coder/blob/3520-doc-prom-metrics/docs/admin/prometheus.md
This PR adds another doc page, that describes the Prometheus endpoint.
I didn't list or describe all metrics on purpose, so we won't end up with outdated content.I added the doc generator, which converts the Prometheus dump into the Markdown table.