Implement basic metric with prometheus#1178
Conversation
yorik
left a comment
There was a problem hiding this comment.
Thank you! I left some comments, but the main question: why to export rates, when just total would be enough?
| rsp = MHD_create_response_from_buffer(str.size(), (void*)str.c_str(), MHD_RESPMEM_MUST_COPY); | ||
| MHD_add_response_header(rsp, "Content-Type", "application/json; charset=utf-8"); | ||
| } | ||
| else if(strcasecmp(url, "/prometheus") == 0) |
There was a problem hiding this comment.
Because it's Prometheus's related format of output. I don't have problem with metric name too. Name can be changed.
There was a problem hiding this comment.
It would require less custom settings, so I think it's better, but this is minor.
| sMetric.gPoolPing = &gauge_family_pool_ping.Add({{"address", "xxx:3333"}}); | ||
|
|
||
| auto& gauge_family_hr_total = BuildGauge() | ||
| .Name("xmrstak_hash_rate_bytes_total") |
There was a problem hiding this comment.
I would named it "xmrstak_hash_rate_total"
There was a problem hiding this comment.
By Prometheus convention units should be in name.
There was a problem hiding this comment.
But unit isn't bytes in this case, it's hashes per second, or am I missing something?
| sMetric.agHashRateTotal[2] = &gauge_family_hr_total.Add({{"le", "900"}}); | ||
|
|
||
| auto& gauge_family_hr = BuildGauge() | ||
| .Name("xmrstak_hash_rate_bytes") |
There was a problem hiding this comment.
I would remove _bytes from here the metric name. Also it would be nice to have device and thread_id labels here too.
There was a problem hiding this comment.
Bytes represent units: https://prometheus.io/docs/practices/naming/. Labels already exits, look at 1348-1362 there are dynamically created.
|
This is optimization :-) If you want total hash rate and you have big amount of data, then query to Prometheus backed is more performed, instead of doing sum calculation on all data aggregated by thread...
|
|
THX for the PR, I will check this PR after the next release. I need first to check what |
|
Hi. I am interested in this, and was wondering if there was a link or document anywhere that can help me set this up (outside of my own obvious searches by using google). I believe it is referencing prometheus.h somewhere, and not sure if the data collection software has to be installed on the xmr-stak miner, or what steps I need to try and set it up. |
|
Hey, looks good, looking forward once it will be merged and released. Any ETA? |
|
@DrStein99 Try that simple steps:
After a few seconds, promethes will be periodically connect (in that case every 15s) to your xmr-stak miner and it will be collects measured data. |
|
Any change to merge it into a current version? |
|
currently I have no time. The changes very old and must be verified/tested
first.
|
Hi all,
This PR implement basic measuring with Prometheus metrics technology.
If you enable metrics while building app, then metrics are available on host:port/promethes
Example of output:
// CC: @yorik