I have n x 2 timeseries: per id, i have 2 series: v=one and v=two.
There is 1 point per minute in each of these series (timestamp aligned).
I need a query that shows for each id, the difference (per timestamp) between the v=one and v=two series. It should output n timeseries (1 per id).
Is this the kind of problem that is to be solved with
http://opentsdb.net/docs/build/html/api_http/query/exp.html ?
Below is my attempt to code this. Unfortunately this does not give me the right answer.
{
"time": {
"start": 1493596800,
"end": 1493683200,
"aggregator":"none"
},
"filters": [
{
"tags": [
{
"type": "literal_or",
"tagk": "v",
"filter": "one",
"groupBy": false
},
{
"type": "wildcard",
"tagk": "id",
"filter": "*",
"groupBy": true
}
],
"id": "v1"
},
{
"tags": [
{
"type": "literal_or",
"tagk": "v",
"filter": "two",
"groupBy": false
},
{
"type": "wildcard",
"tagk": "id",
"filter": "*",
"groupBy": true
}
],
"id": "v2"
}
],
"metrics": [
{
"id": "v1",
"metric": "x",
"filter": "v1"
},
{
"id": "v2",
"metric": "x",
"filter": "v2"
}
],
"expressions": [
{
"id": "delta",
"expr": "v1-v2"
}
],
"outputs":[
{"id":"delta", "alias":"delta"}
]
}