I have a BOSUN server running which is configured to operate on OPENTSDB. I am sending data to OPENTSDB using SCOLLECTOR every minute. What I am looking for is a way to get all possible Tag_Values for a given Tag_Key and Metric_Name which is present in OPENTSDB.
For Example Suppose I have,
metric: data.queue.capacity
tags: queue={queue1,queue2,queue3...}
I am storing capacity for a Number of Queues.This data is there in OPENTSDB. I can query BOSUN for values of metric=data.queue.capacity using query:
q("sum:data.queue.capacity{queue=*}{}","start_time","end_time")
which gives output:
{queue:queue1} :{"timestamp1":"value1","timestamp2":"value2",...}
{queue:queue2} :{"timestamp1":"value1","timestamp2":"value2",...}
.
.
.
The result returned is grouped by different Queue values. It is hard to use above response data to get all possible Queue names because:
What I want is an API where I can give a Metric_Name and Tag_Key and i should get a JSON data having all possible Tag_Values present in OPENTSDB for that Metric_Name,Tag_Key.
After Searching I have found partial solutions: BOSUN have API to get all Tag_values, But for only those metrics which are relayed through BOSUN.
API: /api/tagv/{tagk}/{metric}
This API accept's Tag_key and Metric_Name and for this combination gives all values of Tag_Values.
eg: http://bosun-host:port/api/tagv/{tagk}/{metric}
response:
[
"tag_value1",
"tag_value2"
]
Still I don't have a solution to get Tag_values for metric which are not relayed through BOSUN but directly to OPENTSDB. The solution may not involve BOSUN it could be OPENTSDB API too.
As far as Bosun as concerned, relaying the datapoints to Bosun for that tag metadata is the standard way. You can use tsdbrelay so metrics get copied to Bosun but don't flow through Bosun (this way if Bosun is restarted or is down, metric flow is not interrupted).
With OpenTSDB itself you could look into OpenTSDB Metadata - but Bosun't doesn't use this feature of OpenTSDB.