hoptical / nodegraph-api-plugin

A data source plugin for nodegraph panel in grafana
Apache License 2.0
71 stars 14 forks source link

[BUG] Provisioning Datasource does not work #13

Closed ruddra closed 2 years ago

ruddra commented 2 years ago

Describe the bug I tried to create provisioning datasource by following yml:

apiVersion: 1

datasources:
  - name: datasource
    type: hamedkarbasi93-nodegraphapi-datasource
    access: proxy
    url: http://localhost:8000/api/v1/predicted-data/poly-fit

It created a provisional datasource when I started the grafana, but when I try to use it, it throws error:

image

To Reproduce Steps to reproduce the behavior:

  1. Create datasource.yml
  2. Put it inside /etc/grafana/provisioning/datasources
  3. Restart grafana and create a dashboard with Node graph and use the previous datasource.

Expected behavior Should work.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop Information:

hoptical commented 2 years ago

@ruddra Can you try again with access in direct mode instead of proxy?

ruddra commented 2 years ago

Unfortunately direct did not work

hoptical commented 2 years ago

You have to use baseUrl instead of url in jsonData section:

apiVersion: 1

datasources:
  - name: nodegraph-provision
    type: hamedkarbasi93-nodegraphapi-datasource
    access: direct
    jsonData:
      baseUrl: http://localhost:5000

We will utilize url in the next release to make it compatible with the standard. But for now, you can use the above config.

ruddra commented 2 years ago

Thanks.