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:
- It only returns data between start time and end time, So if a Queue name say queue_not does not have a metric point between start_time and end_time, it will not come in the response.
- This gives a lot of data in response, I can aggregate but I don't think this is the best way to get Tag values.
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.