Hello,
-
I’m installing Grafana OnCall “Hobby” environment using instructions from GitHub - grafana/oncall: Developer-friendly incident response with brilliant Slack integration. And everything works fine if I manually enable the plugin and configure it with “http//engine:8080”
-
But I’m trying to automate this process.
-
I’ve discovered that one can enable and configure a plugin with a
plugin config file
in theprovisioning/plugins
folder
Provision Grafana | Grafana documentation -
After configuring this file:
apiVersion: 1
apps:
- type: grafana-oncall-app
org_id: 1
disabled: false
Plugin is enabled automatically, but I can’t figure out what exactly should be pasted in jsonData and secureJsonData. After manual plugin configuration there were these fields (filled with values) in grafana.db/plugin-setting:
apiVersion: 1
apps:
- type: grafana-oncall-app
org_id: 1
disabled: false
jsonData:
error: null
license: OpenSource
onCallApiUrl: http://engine:8080
orgId: 100
stackId: 5
secureJsonData:
grafanaToken: <token>
onCallApiToken: <token>
And simple debug showed that Grafana sends several GET and POST requests and gets the same key:value pairs in response. But I don’t have any tokens before the start of containers and can’t fill token values in advance.
- Also I’ve found this file on the OnCall github repository:
ttps://github.com/grafana/oncall/blob/b3659872a7a66a53092ca5981e05d3510e0c2370/grafana-plugin/grafana-plugin.yml.example
apps:
- type: grafana-oncall-app
name: grafana-oncall-app
disabled: false
jsonData:
stackId: <Populate via script>
orgId: <Populate via script>
onCallApiUrl: <Populate via script>
secureJsonData:
onCallApiToken: <Populate via script>
but I still can’t understand which script can be helpful in filling this yaml file before the start of containers.
So can you answer whether it is even possible to automate GUI button-clicking with Grafana plugin provisioning file? If so, how?