Skip to main content

Managing Plugins

1. Installing Plugins via CLI

Command Description Options Notes
grafana-cli plugins install Install a plugin from the Grafana Plugin Registry --repo, --pluginVersion Requires Grafana server to be running
grafana-cli plugins list List installed plugins --installed, --update Shows plugin ID, name, and version
grafana-cli plugins uninstall Uninstall a plugin by ID --pluginId Removes plugin from disk and database

Example: Install a plugin via CLI

grafana-cli plugins install grafana-azure-monitor-datasource

Example: Install a specific version of a plugin

grafana-cli plugins install grafana-azure-monitor-datasource 1.2.3
Note: Plugin installation requires Grafana server to be running. After installing, restart the Grafana server for changes to take effect.

2. Installing Plugins via UI

Example: Installing a Plugin via Grafana UI

1. Navigate to Grafana UI
2. Go to Configuration > Plugins
3. Search for desired plugin (e.g., "Prometheus")
4. Click "Install" button
5. Restart Grafana server if prompted
Step Description Action
Access UI Open Grafana web interface Browser access to Grafana URL
Navigate to Plugins Go to plugin management section Configuration > Plugins menu
Search Plugin Find plugin by name or category Use search bar in plugin list
Install Plugin Initiate plugin installation Click "Install" button on plugin card
Restart Server Apply changes to Grafana instance Restart Grafana service (if required)
Note: Some plugins may require additional configuration after installation, such as setting up data sources or dashboards.
Warning: Ensure that the plugin is compatible with your Grafana version to avoid issues.

3. Installing Unsigned Plugins

Note: Installing unsigned plugins is disabled by default for security reasons. You must explicitly enable this feature in Grafana's configuration.
Configuration Option Value Description
plugins.allowUnsigned false Set to true to allow installation of unsigned plugins

Example: Enabling Unsigned Plugin Installation

[plugins]
allowUnsigned = true
Warning: Enabling unsigned plugin installation can pose security risks. Only enable this setting if you trust the source of the plugins.

Security Considerations

  • Unsigned plugins may contain malicious code
  • Enable plugins.allowUnsigned only in trusted environments
  • Regularly audit installed plugins for security vulnerabilities

4. Updating Plugins

Plugin Current Version Latest Version Status
Grafana 11.2.0 11.3.0 NEW
Prometheus 2.3.0 2.4.0 DEPRECATED
Elasticsearch 1.2.0 1.3.0 BETA

Example: Update Plugin via CLI

grafana-cli plugins update <plugin-id>

Example: Update All Plugins

grafana-cli plugins update-all
Note: Ensure Grafana server is running before updating plugins.
Warning: Updating plugins may cause compatibility issues with older versions of Grafana.

5. Removing Plugins

Plugin ID Removal Command Notes
grafana-plugin-id grafana-cli plugins remove grafana-plugin-id Removes the specified plugin from Grafana

Example: Removing a Plugin

grafana-cli plugins remove grafana-worldmap-panel
Note: Ensure Grafana is restarted after removing a plugin to fully unload it from memory.

6. Configuring Plugin Settings

Setting Description Default Value Notes
plugin.enabled Enables or disables a plugin true Set to false to disable a plugin
plugin.allow_loading Allows loading of plugins from external sources false Requires explicit configuration to enable
plugin.trust_external Trusts external plugins without user confirmation false Use with caution in production environments

Example: Enabling a Plugin via Configuration

{
  "plugins": {
    "enabled": true,
    "allow_loading": false,
    "trust_external": false
  }
}
Note: Plugin settings can also be managed through the Grafana UI under Configuration > Plugins.

7. Using Panel Plugins

Property Value Description
panel.type graph Panel type to display data
targets [{...}] Array of query targets to fetch data from
datasource prometheus Name of the data source to use for queries

Example: Adding a Graph Panel

{
  "panel": {
    "type": "graph",
    "targets": [
      {
        "expr": "up",
        "legendFormat": "{{job}}"
      }
    ],
    "datasource": "prometheus"
  }
}
Note: Panel plugins can be installed via the Grafana UI or using the grafana-cli command-line tool.
Warning: Ensure that the panel plugin is compatible with your Grafana version to avoid unexpected behavior.

Panel Plugin Usage Summary

  • Install plugins through the Grafana UI or CLI.
  • Use panel.type to define the visualization type (e.g., graph, table).
  • Define targets to specify data queries.
  • Set the datasource to connect to your data source.

8. Using Data Source Plugins

Property Value Description
type datasource Indicates the plugin type is a data source
name MySQL Name of the data source plugin
id mysql Unique identifier for the plugin
version 1.0.0 Version of the plugin installed

Example: Configuring a MySQL Data Source

{
  "name": "MySQL-DS",
  "type": "mysql",
  "access": "proxy",
  "url": "localhost:3306",
  "database": "grafana_db",
  "user": "admin",
  "password": "secret123"
}
Note: Ensure the data source plugin is compatible with your Grafana version.
Warning: Never store passwords in plain text in configuration files.
Configuration Option Description Default Value
url Database connection URL localhost:3306
database Name of the database to connect to grafana_db
user Database user for authentication admin
password Password for the database user secret123

9. Using App Plugins

App plugins in Grafana are powerful extensions that provide additional functionality, such as new data sources, panels, or application features. They are designed to be self-contained and can be installed and managed through the Grafana interface or CLI.

Property Description Example
appPlugin.id Unique identifier for the app plugin "myapp-plugin"
appPlugin.name Display name of the app plugin "My App Plugin"
appPlugin.version Version of the app plugin "1.0.0"
appPlugin.type Indicates the plugin type (e.g., datasource, panel) "app"

Example: Installing an App Plugin via CLI

grafana-cli plugins install myapp-plugin

Example: Enabling an App Plugin in Grafana

{
  "plugins": [
    {
      "id": "myapp-plugin",
      "enabled": true
    }
  ]
}
Note: App plugins must be signed and verified by Grafana to ensure security and compatibility.
Warning: Installing unsigned or untrusted plugins can pose security risks. Always verify plugin sources.

Key Points About App Plugins

  • App plugins extend Grafana’s functionality with custom features.
  • They can be installed via the Grafana UI or CLI.
  • Plugins must be enabled in the configuration to be active.
  • Ensure plugins are from trusted sources to avoid security vulnerabilities.

10. Managing Plugin Permissions

Permission Resource Description Level
plugins:install plugin Allows installing plugins from the Grafana plugin repository Admin
plugins:uninstall plugin Allows uninstalling plugins Admin
plugins:configure plugin Allows configuring plugin settings and options Editor
plugins:read plugin Allows reading plugin metadata and status Viewer

Example: Configure Plugin Permissions via API

curl -X POST "http://localhost:3000/api/plugins/grafana-piechart-panel" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{"enabled": true, "pluginId": "grafana-piechart-panel"}'
Note: Plugin permissions can be managed through the Grafana UI under Configuration > Plugins. Admins can enable or disable plugins and configure their settings.

Was this article helpful?