Google Cloud Monitoring provisioning Datasource

  • What Grafana version and what operating system are you using?
    v9.1.7

  • What are you trying to achieve?
    Get the Google Cloud Monitoring data source up and running

  • How are you trying to achieve it?
    i need to provisioning datasource

  • What happened?
    an error appears : Plugin health check failed

  • What did you expect to happen?
    that everything works correctly

  • Can you copy/paste the configuration(s) that you are having problems with?
    Obviously, i changed my private data to avoid revelated
    {
    apiVersion: 1,
    datasources: [
    {
    access: proxy,
    editable: false,
    name: prometheus,
    orgId: 1,
    type: prometheus,
    url: http://xxxxxxxxxxxxxxx,
    version: 1
    },
    {
    name: test,
    type: stackdriver,
    access: proxy,
    editable: true,
    orgId: 1,
    version: 1,
    isDefault: false,
    jsonData: {
    tokenUri: https://oauth2.googleapis.com/token,
    clientEmail: service-account-of-google@projectid.iam.gserviceaccount.com,
    authenticationType: jwt,
    defaultProject: my-project},
    secureJsonData: {
    privateKey:
    “-----BEGIN PRIVATE KEY-----
    myprivatekey hash
    -----END PRIVATE KEY-----”
    }
    }
    ]
    }

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Yes, i just receive the next message: Plugin health check failed
    this not happen when i add a manual datasource.
    The same data entered via manual i have not problem. Only happen when i try to provisioning datasource.

  • Did you follow any online instructions? If so, what is the URL?
    Yes, the official documentation

welcome to the :grafana: forum, @androide

how exactly are you provisioning? Are you using configuration management tools like ansible or terraform? Are you adding .yaml files to a grafana directory? PLease include more details and reproduction steps so we can help you.

Also. try increasing the verbosity of the Grafana server logs to debug and note any errors. For printing to console, set the console logs to debug as well.

Same. If I manually create GCM datasource in Grafana webui, it works fine. In other words by pasting or uploading the json key. When provisioning, the same key produces error “Plugin health check failed”, and GCM dashboards also error:

Error updating options: Unexpected token ‘u’, “unexpected”… is not valid JSON.

@androide did you ever find a solution?

I’m following doc and trying to use:

datasources:
  datasources.yaml:
    apiVersion: 1
    datasources:
      - name: Google Cloud Monitoring
        type: stackdriver
        access: proxy
        jsonData:
          tokenUri: https://oauth2.googleapis.com/token
          clientEmail: <service-account>@<my_project>.iam.gserviceaccount.com
          authenticationType: jwt
          defaultProject: <my_project>
        secureJsonData:
          privateKey: |
             <private_key>

Were you ever able to figure this out? I’m also trying to provision the datasource via configuration file and I think I’m running into the same problem you were. I’m able to configure it manually via the Grafana console, but I seem to be missing something with trying to provision via a configuration (using grafana-operator).