How to query stored series by a given tag value?

48 views
Skip to first unread message

Tobias Paul

unread,
Jun 19, 2020, 2:59:24 AM6/19/20
to KairosDB
Is there any possibility to query all stored series (tag combinations and metric names) which have a specific tag value?
For example, if I only know the hostname of a server but not the stored metric names and any other related tags.

Example:

stored series

traffic_in;host=server1;interface=eth0
traffic_out;host=server1;interface=eth0
traffic_in;host=server1;interface=eth1
traffic_out;host=server1;interface=eth1
traffic_in;host=server2;interface=eth0
traffic_out;host=server2;interface=eth0
traffic_in;host=server3;interface=eth0
traffic_out;host=server3;interface=eth0
traffic_in;host=server3;interface=eth1
traffic_out;host=server3;interface=eth1


expected result for "host=server2"

"results": [
{
"name": "traffic_in",
"tags": {
"host": [
"server2"
],
"interface": [
"eth0"
]
}
},
{
"name": "traffic_out",
"tags": {
"host": [
"server2"
],
"interface": [
"eth0"
]
}
}
]


Brian Hawkins

unread,
Aug 11, 2020, 10:44:08 PM8/11/20
to KairosDB
Not directly no.  I've added extension points to allow a plugin to do this sort of thing but it isn't built in.  I've had the same desire for exactly your use case, I want to know all metrics that are being reported from a specific host.  Why have I not added it you ask?  Well processing tag data in Kairos is like drinking from a fire hose.  it is easy to get overwhelmed and drown.  So making a generic plugin/enhancement that won't kill the system is tricky unless I put a lot of restrictions on it.  We could build a pluigin that will only create these secondary indexes on specific tag and it would need a cache so as to not increase C* traffic.

Brian
Reply all
Reply to author
Forward
0 new messages