{
    "$id": "https://grafana.com/plugin-metadata",
    "$schema": "http://json-schema.org/draft-07/schema",
    "additionalProperties": false,
    "description": "The plugin.json file is required for all plugins. When Grafana starts, it scans the plugin folders and mounts every folder that contains a plugin.json file unless the folder contains a subfolder named dist. In that case, Grafana mounts the dist folder instead.",
    "properties": {
        "alerting": {
            "description": "For data source plugins. If the plugin supports alerting.",
            "type": "boolean"
        },
        "annotations": {
            "description": "For data source plugins. If the plugin supports annotation queries.",
            "type": "boolean"
        },
        "backend": {
            "description": "If the plugin has a backend component.",
            "type": "boolean"
        },
        "category": {
            "description": "Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, and `sql`.",
            "enum": [
                "tsdb",
                "logging",
                "cloud",
                "tracing",
                "sql"
            ],
            "type": "string"
        },
        "dependencies": {
            "additionalProperties": false,
            "description": "Plugin dependencies.",
            "properties": {
                "grafanaVersion": {
                    "description": "Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x.",
                    "pattern": "^([0-9x]+\\.[0-9x]+\\.*[0-9x]*\\s*)+$",
                    "type": "string"
                },
                "plugins": {
                    "description": "An array of required plugins on which this plugin depends.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                }
            },
            "required": [
                "grafanaVersion"
            ],
            "type": "object"
        },
        "executable": {
            "description": "The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `<executable>_<$GOOS>_<lower case $GOARCH><.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment.",
            "type": "string"
        },
        "hiddenQueries": {
            "type": "boolean"
        },
        "id": {
            "description": "Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions.",
            "pattern": "^[0-9a-z\\-]+$",
            "type": "string"
        },
        "includes": {
            "items": {
                "additionalItems": false,
                "properties": {
                    "addToNav": {
                        "type": "boolean"
                    },
                    "component": {
                        "type": "string"
                    },
                    "defaultNav": {
                        "type": "boolean"
                    },
                    "name": {
                        "type": "string"
                    },
                    "role": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "type": "array"
        },
        "info": {
            "additionalProperties": false,
            "description": "Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published.",
            "properties": {
                "author": {
                    "additionalProperties": false,
                    "description": "Information about the plugin author.",
                    "properties": {
                        "email": {
                            "_format": "email",
                            "description": "Author's name.",
                            "type": "string"
                        },
                        "name": {
                            "description": "Author's name.",
                            "type": "string"
                        },
                        "url": {
                            "_format": "uri",
                            "description": "Link to author's website.",
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "description": {
                    "description": "Description of plugin. Used on the plugins page in Grafana and for search on grafana.com.",
                    "type": "string"
                },
                "keywords": {
                    "description": "Array of plugin keywords. Used for search on grafana.com.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "links": {
                    "description": "An array of link objects to be displayed on this plugin's project page in the form `{name: 'foo', url: 'http://example.com'}`",
                    "items": {
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "url": {
                                "_format": "uri",
                                "type": "string"
                            }
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "logos": {
                    "additionalProperties": false,
                    "description": "SVG images that are used as plugin icons.",
                    "properties": {
                        "large": {
                            "description": "Link to the \"large\" version of the plugin logo, which must be an SVG image. \"Large\" and \"small\" logos can be the same image.",
                            "type": "string"
                        },
                        "small": {
                            "description": "Link to the \"small\" version of the plugin logo, which must be an SVG image. \"Large\" and \"small\" logos can be the same image.",
                            "type": "string"
                        }
                    },
                    "required": [
                        "small",
                        "large"
                    ],
                    "type": "object"
                },
                "screenshots": {
                    "description": "An array of screenshot objects in the form `{name: 'bar', path: 'img/screenshot.png'}`",
                    "items": {
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "path": {
                                "type": "string"
                            }
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "updated": {
                    "description": "Date when this plugin was built.",
                    "pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\%TODAY\\%)$",
                    "type": "string"
                },
                "version": {
                    "description": "Project version of this commit, e.g. `6.7.x`.",
                    "pattern": "^([0-9x]+\\.[0-9x]+\\.*[0-9x]*$|\\%VERSION\\%)",
                    "type": "string"
                }
            },
            "required": [
                "logos",
                "version",
                "updated"
            ],
            "type": "object"
        },
        "logs": {
            "description": "For data source plugins. If the plugin supports logs.",
            "type": "boolean"
        },
        "metrics": {
            "description": "For data source plugins. If the plugin supports metric queries. Used in the Explore feature.",
            "type": "boolean"
        },
        "mixed": {
            "description": "Not to be used by external plugins. Special property for the built-in mixed plugin.",
            "type": "boolean"
        },
        "module": {
            "type": "string"
        },
        "name": {
            "description": "Human-readable name of the plugin that is shown to the user in the UI.",
            "type": "string"
        },
        "partials": {
            "additionalItems": false,
            "properties": {
                "config": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "queryOptions": {
            "additionalProperties": false,
            "description": "For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed.",
            "properties": {
                "cacheTimeout": {
                    "description": "For data source plugins. If the `cache timeout` option should be shown in the query options section in the query editor.",
                    "type": "boolean"
                },
                "maxDataPoints": {
                    "description": "For data source plugins. If the `max data points` option should be shown in the query options section in the query editor.",
                    "type": "boolean"
                },
                "minInterval": {
                    "description": "For data source plugins. If the `min interval` option should be shown in the query options section in the query editor.",
                    "type": "boolean"
                }
            },
            "type": "object"
        },
        "routes": {
            "description": "For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).",
            "items": {
                "additionalProperties": false,
                "description": "For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).",
                "properties": {
                    "headers": {
                        "description": "For data source plugins. Route headers adds HTTP headers to the proxied request.",
                        "type": "array"
                    },
                    "method": {
                        "description": "For data source plugins. Route method matches the HTTP verb like GET or POST.",
                        "type": "string"
                    },
                    "path": {
                        "description": "For data source plugins. The route path that is replaced by the route URL field when proxying the call.",
                        "type": "string"
                    },
                    "reqRole": {
                        "type": "string"
                    },
                    "reqSignedIn": {
                        "type": "boolean"
                    },
                    "tokenAuth": {
                        "additionalProperties": false,
                        "description": "For data source plugins. Token authentication section used with an OAuth API.",
                        "properties": {
                            "params": {
                                "additionalProperties": false,
                                "description": "For data source plugins. Parameters for the token authentication request.",
                                "properties": {
                                    "client_id": {
                                        "description": "For data source plugins. OAuth client id.",
                                        "type": "string"
                                    },
                                    "client_secret": {
                                        "description": "For data source plugins. OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob.",
                                        "type": "string"
                                    },
                                    "grant_type": {
                                        "description": "For data source plugins. OAuth grant type.",
                                        "type": "string"
                                    },
                                    "resource": {
                                        "description": "For data source plugins. OAuth resource.",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            },
                            "url": {
                                "_format": "uri",
                                "description": "For data source plugins. URL to fetch the authentication token.",
                                "type": "string"
                            }
                        },
                        "type": "object"
                    },
                    "url": {
                        "_format": "uri",
                        "description": "For data source plugins. Route URL is where the request is proxied to.",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "type": "array"
        },
        "sort": {
            "description": "Internal property for sorting. Cannot be used as will be overwritten by Grafana.",
            "type": "number"
        },
        "staticRoot": {
            "type": "string"
        },
        "streaming": {
            "description": "For data source plugins. If the plugin supports streaming.",
            "type": "boolean"
        },
        "tables": {
            "type": "boolean"
        },
        "tracing": {
            "description": "For data source plugins. If the plugin supports tracing.",
            "type": "boolean"
        },
        "type": {
            "description": "Plugin type. Possible values are `app`, `datasource`, and `panel`.",
            "enum": [
                "app",
                "datasource",
                "panel"
            ],
            "type": "string"
        }
    },
    "required": [
        "type",
        "name",
        "id",
        "info",
        "dependencies"
    ],
    "title": "plugin.json",
    "type": "object"
}