cloud-logging-data-source-plugin icon indicating copy to clipboard operation
cloud-logging-data-source-plugin copied to clipboard

Authentificating datasource with grafana provisioning

Open icdef opened this issue 1 year ago • 4 comments

The docs say, that the provisioning is similar to the Google Cloud Monitoring plugin for datasources However it does not support privateKeyPath and/or all the other fields in jsonData. Are they gonna be supported in the future? Something like this does not work, even though the private key is mounted. The other fields such as defaultProject or clientEmail are not set as well.

  - name: Google Cloud Logging
    type: googlecloud-logging-datasource
    access: proxy
    jsonData:
      tokenUri: tokenURI
      clientEmail: [email protected]
      authenticationType: jwt
      defaultProject: projectName
      privateKeyPath: /etc/secrets/privateKey.pem

icdef avatar May 15 '24 07:05 icdef

Similar question regarding private key. For Google Cloud Monitoring, I pass:

 secureJsonData:
      privateKey: ${PROV_GCP_PRIVATE_KEY} # env var containing the service account's private key

When I pass this to this plugin, I get

google: could not parse key: private key should be a PEM or plain PKCS1 or PKCS8; parse error: asn1: structure error: tags don't match (16 vs {class:0 tag:13 length:45 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2

How can I set this up for provisioning?

mbrevda avatar Jun 06 '24 16:06 mbrevda