Configure a Service Key in the plugin - SAP/alm-plug-in-for-grafana GitHub Wiki

Once a service key has been created for the SAP Cloud ALM API Instance, it can be used to configure the ALM Grafana Plugin.

Several keys can be created and configured against different instances of the Data Source plugin in the Grafana instance configuration.

As described here, the configuration is based on the definition of a route in the plugin.json file of your plugin directory.

Step by Step

  1. Select your newly created service key and retrieve the following information:
  • endpoints
    • Api
  • uaa
    • clientid
    • clientsecret
    • url

2022-11-04_14-36-22 copy

  1. Edit the plugin.json file in the plugin directory of the Grafana instance (usually YOUR_PLUGIN_DIR/sap-alm-dp-api-datasource/dist/) and add the following in the route section

Note The path to the plugin directory is defined in the configuration file grafana.ini.

{
      "path": "ABC",
      "url": "https://eu10.alm.cloud.sap/api/calm-analytics/v1",
        "tokenAuth": {
          "url": "https://demo-acme.authentication.eu10.hana.ondemand.com/oauth/token",
          "params": {
            "grant_type": "client_credentials",
            "client_id": "XXXXXXXXXXXXXX",
            "client_secret": "xxxxxxxxxxxxxxxxx"

                    }          
                      }
}

  • path: three characters that will be used in the plugin configuration to identify this specific credential (e.g. "ABC")
  • url: this is the endpoints: Api value retrieved from the service key followed by "/calm-analytics/v1" (e.g., https://eu10.alm.cloud.sap/api/calm-analytics/v1)
  • tokenAuth-url: this is the uaa: url value retrieved from the service key followed by "/oauth/token" (e.g., https://demo-acme.authentication.eu10.hana.ondemand.com/oauth/token)
  • client_id: this is the uaa: clientid value retrieved from the service key
  • client_secret: this is the uaa: clientsecret value retrieved from the service key
  1. Save the plugin.json file and restart the Grafana instance