I would like to use KairosDB Java client to check KairosDB health but it seems there is too few guides. Anyone knows please help me?
Asked
Active
Viewed 225 times
0
-
Hi, what do you mean by checking KairosDB health? Do you want to retrieve some KairosDB metrics or do you want to poll for its health using another method? – Loic Jul 23 '15 at 13:37
1 Answers
0
I have commented the question to get more details about what you want to do.
However one interesting metric is the HTTP request time in kairosDB (kairosdb.http.request_time). By polling this metric you will: - Make sure metrics are recorded - Make sure http requests are received, processed and answered in reasonable time (although long queries will report longer time than others)
To do so you can follow the example on https://github.com/kairosdb/kairosdb-client, e.g. by doing this kind of query every five minutes:
QueryBuilder builder = QueryBuilder.getInstance();
builder.setStart(10, TimeUnit.MINUTES)
.setEnd(0, TimeUnit.MINUTES)
.addMetric("kairosdb.http.request_time")
.addGrouper(new TagGrouper("host"));
HttpClient client = new HttpClient("http://localhost:8080");
QueryResponse response = client.query(builder);
client.shutdown();
I hope this helps.
Regards, Loic

Loic
- 1,088
- 7
- 19
-
In short, I would like to check if the KairosDB is currently healthy or not. I am going to make something called heartbeat reporter. This program periodically checks the system health in general and KairosDB (also Cassandra) in particular then sends these all information to a heartbeart collector. – duong_dajgja Jul 24 '15 at 02:34