vsergeyev / loudml-grafana-app

Visualization panel and datasource for Grafana to connect with Loud ML AI solution for ICT and IoT automation
https://vsergeyev.github.io/loudml-grafana-app/
MIT License
48 stars 21 forks source link

Multivariable option for the model #6

Open vsergeyev opened 4 years ago

vsergeyev commented 4 years ago

Add capability to have more than 1 metric in LoudML Grafana panel.

fadjar340 commented 4 years ago

Wow....

vsergeyev commented 4 years ago

Added a parser to use all fields from InfluxDB query in Grafana panel. And it converts these fields into features in ML model then. And able to send it to server.

Example model:

{
    "bucket_interval":"10s",
    "default_bucket":"influxdb2",
    "features":[{
        "name":"mean_queryReqDurationNs",
        "measurement":"httpd",
        "field":"queryReqDurationNs",
        "metric":"mean",
        "io":"io",
        "default":"previous",
        "match_all":[]
    },{
        "name":"mean_queryRespBytes",
        "measurement":"httpd",
        "field":"queryRespBytes",
        "metric":"mean",
        "io":"io",
        "default":"previous",
        "match_all":[]
    }],
    "interval":"10s",
    "max_evals":10,
    "name":"_internal_httpd_mean_queryReqDurationNs__time_10s",
    "offset":"10s",
    "span":100,
    "type":"donut"
}

Right now one obstacle is a LoudML server support - "This model type supports one unique feature" error returned.

@regel may you please advice is it any principle issue with support for many features in 1 ML model exists.

regel commented 4 years ago

Hi @vsergeyev, the multivariate implementation is not available today. I hope it will be in the future.

It’s nice to have Grafana setup and ready for testing even if the multi variable feature is not available yet. Should this be an option to enable in a configuration panel of Grafana?

vsergeyev commented 4 years ago

@regel it works out of the box when you select fields in Query in panel.

loudml_grafana_multi_features
vsergeyev commented 4 years ago

One may give it a try with 1.4.0 in docker:

Grafana 6.x:

sudo docker run -d \
  -p 3000:3000 \
  --name=grafana \
  -e "GF_INSTALL_PLUGINS=https://github.com/vsergeyev/loudml-grafana-app/raw/master/loudml-grafana-app-1.4.0.zip;loudml-grafana-app" \
  grafana/grafana

Grafana 7.x:

sudo docker run -d \
  -p 3000:3000 \
  --name=grafana \
  -e "GF_INSTALL_PLUGINS=https://github.com/vsergeyev/loudml-grafana-app/raw/master/loudml-grafana-app-1.4.0-grafana7.zip;loudml-grafana-app" \
  grafana/grafana