How can my backend plugin access configuration from the grafana.ini

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

    • For development: Dockerized (linux) Grafana of version 8.1.0
  • What are you trying to achieve?

    • Getting a secure configuration value (i.e. “secure_only = true”)
  • How are you trying to achieve it?

    • I want to read this value from the grafana.ini file
  • What happened?

    • My backend plugin does not seem to have access to this configuration

For reference: I am the maintainer of the already existing and working SQLite plugin. So I have a working plugin, but just need to add a new feature.

Hi @frser

Generally speaking plugins can’t access values from grafana.ini unless explicitly passed to them by grafana core.

If the user sets under its configuration a [plugin.$pluginid] section it can be used to pass specific configuration to the plugin but this doesn’t work too well in Grafana cloud and you can probably achieve much better results via the configuration form of a plugin.

Do you have an example repository or documentation for that? That would be very helpful

In my case I have a security related configuration that should not be available to people creating data sources in the UI

take a look at Configure Grafana | Grafana documentation

Thanks. I saw this option but could not get it working.

Are you aware of any open source plugin that uses such a configuration so I can check how they do it?

Not in the backend that I can find. the grafana image renderer is using them in the frontend.

Yeah, that is the only plugin I could find using this.

But with the backend plug-in I cannot seem to get this information…