grafana-json-datasource icon indicating copy to clipboard operation
grafana-json-datasource copied to clipboard

Data source provisioning as code is broken

Open jnunezgts opened this issue 1 year ago • 1 comments

The data source provisioning is broken:

  1. If you define user authentication it is ignored by Grafana, you need to make the data source editable and then once is loaded in the UI you can provision it
  2. You cannot link a dashboard with the provisioned data source, even after providing a 'uid'. Instead Grafana ignores it and creates a new uid, which breaks the provisioning.

For example, the following breaks:

# User Authentication is broken for the provisioning!
# Workaround: Make the datasource editable and fix it after deployment
# https://github.com/grafana/grafana-json-datasource/issues/298
---
apiversion: 1
deleteDatasources:
  - name: "test"
datasources:
  - name: "test"
    type: marcusolsson-json-datasource
    url: https://machine.example.com/rest/api
    basicAuth: true
    basicAuthUser: "user"
    isDefault: false
    editable: true
    version: 11
    uid: "RD-rXQV4A"
    secureJsonData:
      basicAuthPassword: "ZZZ"

Grafana version: 9.2.4 OS: Linux Fedora 29 ** Browser**: Chrome ** Plugin version**: 1.3.1

jnunezgts avatar Mar 22 '23 00:03 jnunezgts

same problem

bastifpv avatar Jul 06 '23 08:07 bastifpv

hi @jnunezgts , sorry, i was not able to reproduce this. i tried it with a provisioning file like this:

apiVersion: 1

datasources:
  - name: jauth
    uid: jauth
    type: marcusolsson-json-datasource
    url: http://localhost:5555/test.json
    basicAuth: true
    basicAuthUser: user1
    secureJsonData:
      basicAuthPassword: pass1

and it created the datasource that had correct uid and sent the correct http-basic-auth info to the server.

could you try with the newest grafana version and with the newest json plugin version?

gabor avatar May 24 '24 14:05 gabor

as we got no new information, we're closing the issue. we can reopen it if we get new info.

gabor avatar Jun 21 '24 08:06 gabor

still not working

furkancetn avatar Jul 20 '24 20:07 furkancetn

@furkancetn i'm sorry to hear it's not working for you. unfortunately we were not able to reproduce it, so if still does not work for you please do the following:

  1. test with the current grafana-version and plugin-version
  2. if it does not work, please create a new github issue, and describe the version numbers from [1], and also the error in detail.

thanks!

gabor avatar Jul 26 '24 12:07 gabor