grafana / kairosdb-datasource

Data source plugin for KairosDB
Apache License 2.0
30 stars 62 forks source link

groupby does not work #42

Closed 0zeroth closed 7 years ago

0zeroth commented 7 years ago

It appears that when KairosDB has multiple values for a metric with the same timestamp, but different tags, Grafana just averages the values. This behaviour seems default - it happens when no tags / group by / aggregator is set, and the behaviour does not change even when "group by" is set.

The following query in the KairosDB web ui:

{
  "metrics": [
    {
      "tags": {},
      "name": "metricB",
      "group_by": [
        {
          "name": "tag",
          "tags": [
            "index1"
          ]
        }
      ],
      "aggregators": [
        {
          "name": "sum",
          "align_sampling": true,
          "sampling": {
            "value": "1",
            "unit": "milliseconds"
          }
        }
      ]
    }
  ],
  "cache_time": 0,
  "start_relative": {
    "value": "4",
    "unit": "years"
  }
}

gives a graph like: image

A similar config in Grafana does not work:

image

image

Note the Grafana data points are the average of the datapoints shown in the KairosDB web UI

tmalaska commented 7 years ago

I'm experiencing this as well

jifwin commented 7 years ago

I'm going to look at that soon.

TedBear42 commented 7 years ago

Hey jifwin,

If you have time next week I would love to connect. We are thinking about using this plugin for a very large project, and we would like to become more involved.

Please send me an e-mail if you are free I would love to chat.

Ted Malaska

jifwin commented 7 years ago

Hi @TedBear42 I'd love to talk, but I can't find any contact point to you, also github doesn't support private messaging anymore. Please send me an email: text2image_p34941_20170130_164212

jifwin commented 7 years ago

@0zeroth You should click on the little "plus" icon to apply grouping by. If that is not the case please reopen this issue.

Also please note that this UI looks so strange since it's not upgraded to Grafana 4 standards. Once we merge #40 it should be refined.