loudml icon indicating copy to clipboard operation
loudml copied to clipboard

Error using derivative operator

Open trunet opened this issue 6 years ago • 0 comments

I'm trying to train a counter (GAUGE) metric. Therefore derivative is needed to calculate requests/timeframe.

[root@influxdb01 ~]# loudml train --from "now-60d" --to "now" nginx_requests-model
INFO:root:connecting to influxdb on localhost:8086, using database 'annotations'
INFO:root:train(nginx_requests-model) range=2019-06-14T13:07:00.000Z-2019-08-13T13:08:00.000Z train_size=0.670000 batch_size=256 epochs=100)
INFO:root:connecting to influxdb on localhost:8086, using database 'telegraf'
ERROR:root:datasource[telegraf]: aggregate function required inside the call to derivative

My model is as follow:

{
  "bucket_interval": "1m",
  "default_datasource": "telegraf",
  "features": [
    {
      "match_all": [
        {"tag": "host", "value": "plesk01"}
      ],
      "default": "previous",
      "field": "requests",
      "measurement": "nginx",
      "metric": "derivative",
      "name": "nginx_requests_feature"
    }
  ],
  "interval": 60,
  "max_evals": 10,
  "name": "nginx_requests-model",
  "offset": 60,
  "span": 10,
  "max_threshold": 90,
  "min_threshold": 50,
  "type": "donut"
}

trunet avatar Aug 13 '19 13:08 trunet