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

Support local gcloud default credentials

Open Stono opened this issue 2 years ago • 1 comments

I'm struggling to run grafana locally and use this data source. Ideally i'd like it to use my gcloud auth default credentials. The two configuration options at the moment look to be json (which i want to avoid) and gce (which isn't relevant locally).

It'd be great if this just transparently worked, like gcloud client libraries.

Stono avatar Jul 30 '23 07:07 Stono

You can try to specify the auth type as gce in the configuration file. As you can see in the code, for gce auth the plugin uses application default credentials with client library.

Below is an example of the config file:

sudo cat /etc/grafana/provisioning/datasources/logging.yaml

# # config file version
apiVersion: 1

datasources:
  - name: Google Cloud Logging
    type: googlecloud-logging-datasource
    access: proxy
    editable: true
    jsonData:
      authenticationType: gce
      gceDefaultProject: shenxiang-gcp-solutions-test1

xiangshen-dk avatar Oct 03 '23 06:10 xiangshen-dk