| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | --- | 
					
						
							|  |  |  | page_title: Configuration | 
					
						
							|  |  |  | page_description: Configuration guide for Grafana. | 
					
						
							|  |  |  | page_keywords: grafana, configuration, documentation | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Configuration
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | The Grafana back-end has a number of configuration options that can be | 
					
						
							|  |  |  | specified in a `.ini` configuration file or specified using environment variables. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Config file locations
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - Default configuration from `$WORKING_DIR/conf/defaults.ini` | 
					
						
							|  |  |  | - Custom configuration from `$WORKING_DIR/conf/custom.ini` | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | - The custom configuration file path can be overridden using the `--config` parameter | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | > **Note.** If you have installed Grafana using the `deb` or `rpm`
 | 
					
						
							|  |  |  | > packages, then your configuration file is located at
 | 
					
						
							|  |  |  | > `/etc/grafana/grafana.ini`. This path is specified in the Grafana
 | 
					
						
							|  |  |  | > init.d script using `--config` file parameter.
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | ## Using environment variables
 | 
					
						
							| 
									
										
										
										
											2015-03-12 02:32:06 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | All options in the configuration file (listed below) can be overridden | 
					
						
							|  |  |  | using environment variables using the syntax: | 
					
						
							| 
									
										
										
										
											2015-03-12 02:32:06 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  |     GF_<SectionName>_<KeyName> | 
					
						
							| 
									
										
										
										
											2015-03-12 02:32:06 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | Where the section name is the text within the brackets. Everything | 
					
						
							|  |  |  | should be upper case. For example, given this configuration setting: | 
					
						
							| 
									
										
										
										
											2015-03-12 02:32:06 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     [security] | 
					
						
							|  |  |  |     admin_user = admin | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Then you can override that using: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     export GF_SECURITY_ADMIN_USER=true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | <hr> | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-13 03:31:35 +08:00
										 |  |  | ## [paths]
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### data
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Path to where Grafana stores the sqlite3 database (if used), file based | 
					
						
							|  |  |  | sessions (if used), and other data.  This path is usually specified via | 
					
						
							|  |  |  | command line in the init.d script or the systemd service file. | 
					
						
							| 
									
										
										
										
											2015-04-13 03:31:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### logs
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Path to where Grafana will store logs. This path is usually specified via | 
					
						
							|  |  |  | command line in the init.d script or the systemd service file.  It can | 
					
						
							|  |  |  | be overridden in the configuration file or in the default environment variable | 
					
						
							|  |  |  | file. | 
					
						
							| 
									
										
										
										
											2015-04-13 03:31:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | ## [server]
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### http_addr
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The IP address to bind to, if empty will bind to all interfaces | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### http_port
 | 
					
						
							| 
									
										
										
										
											2015-04-01 23:24:08 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | The port to bind to, defaults to `3000`. To use port 80 you need to | 
					
						
							|  |  |  | either give the Grafana binary permission for example: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     $ sudo setcap 'cap_net_bind_service=+ep' /opt/grafana/current/grafana | 
					
						
							| 
									
										
										
										
											2015-04-01 23:24:08 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | Or redirect port 80 to the Grafana port using: | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  |     $ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Another way is put a webserver like Nginx or Apache in front of Grafana and have them proxy requests to Grafana. | 
					
						
							| 
									
										
										
										
											2015-04-07 22:48:30 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### protocol
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 22:48:30 +08:00
										 |  |  | `http` or `https` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | ### domain
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | This setting is only used in as a part of the `root_url` setting (see below). Important if you | 
					
						
							|  |  |  | use GitHub or Google OAuth. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-05 17:21:06 +08:00
										 |  |  | ### enforce_domain
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Redirect to correct domain if host header does not match domain. | 
					
						
							|  |  |  | Prevents DNS rebinding attacks. Default is false. | 
					
						
							| 
									
										
										
										
											2015-05-05 17:21:06 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | ### root_url
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | This is the full URL used to access Grafana from a web browser. This is | 
					
						
							|  |  |  | important if you use Google or GitHub OAuth authentication (for the | 
					
						
							|  |  |  | callback URL to be correct). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | > **Note** This setting is also important if you have a reverse proxy
 | 
					
						
							|  |  |  | > in front of Grafana that exposes it through a subpath. In that
 | 
					
						
							|  |  |  | > case add the subpath to the end of this URL setting.
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### static_root_path
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The path to the directory where the front end files (HTML, JS, and CSS | 
					
						
							|  |  |  | files). Default to `public` which is why the Grafana binary needs to be | 
					
						
							|  |  |  | executed with working directory set to the installation path. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 22:48:30 +08:00
										 |  |  | ### cert_file
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Path to the certificate file (if `protocol` is set to `https`). | 
					
						
							| 
									
										
										
										
											2015-04-07 22:48:30 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### cert_key
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Path to the certificate key file (if `protocol` is set to `https`). | 
					
						
							| 
									
										
										
										
											2015-04-07 22:48:30 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-30 15:22:58 +08:00
										 |  |  | <hr> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | <hr> | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | ## [database]
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | Grafana needs a database to store users and dashboards (and other | 
					
						
							|  |  |  | things). By default it is configured to use `sqlite3` which is an | 
					
						
							|  |  |  | embedded database (included in the main Grafana binary). | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### type
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | Either `mysql`, `postgres` or `sqlite3`, it's your choice. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### path
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Only applicable for `sqlite3` database. The file path where the database | 
					
						
							|  |  |  | will be stored. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### host
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Only applicable to MySQL or Postgres. Includes IP or hostname and port. | 
					
						
							|  |  |  | For example, for MySQL running on the same host as Grafana: `host = | 
					
						
							|  |  |  | 127.0.0.1:3306` | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### name
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The name of the Grafana database. Leave it set to `grafana` or some | 
					
						
							|  |  |  | other name. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### user
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | The database user (not applicable for `sqlite3`). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### password
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | The database user's password (not applicable for `sqlite3`). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### ssl_mode
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | For `postgres` only, either `disable`, `require` or `verify-full`. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | <hr> | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | ## [security]
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### admin_user
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The name of the default Grafana admin user (who has full permissions). | 
					
						
							|  |  |  | Defaults to `admin`. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### admin_password
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The password of the default Grafana admin.  Defaults to `admin`. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### login_remember_days
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | The number of days the keep me logged in / remember me cookie lasts. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### secret_key
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | Used for signing keep me logged in / remember me cookies. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-01 14:40:13 +08:00
										 |  |  | ### disable_gravatar
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Set to `true` to disable the use of Gravatar for user profile images. | 
					
						
							|  |  |  | Default is `false`. | 
					
						
							| 
									
										
										
										
											2015-05-01 14:40:13 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | <hr> | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-01 21:01:31 +08:00
										 |  |  | ## [users]
 | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### allow_sign_up
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Set to `false` to prohibit users from being able to sign up / create | 
					
						
							|  |  |  | user accounts. Defaults to `true`.  The admin user can still create | 
					
						
							|  |  |  | users from the [Grafana Admin Pages](../reference/admin.md) | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### allow_org_create
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Set to `false` to prohibit users from creating new organizations. | 
					
						
							|  |  |  | Defaults to `true`. | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### auto_assign_org
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Set to `true` to automatically add new users to the main organization | 
					
						
							|  |  |  | (id 1). When set to `false`, new users will automatically cause a new | 
					
						
							|  |  |  | organization to be created for that new user. | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### auto_assign_org_role
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The role new users will be assigned for the main organization (if the | 
					
						
							|  |  |  | above setting is set to true).  Defaults to `Viewer`, other valid | 
					
						
							|  |  |  | options are `Admin` and `Editor`. | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | <hr> | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | ## [auth.anonymous]
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### enabled
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | Set to `true` to enable anonymous access. Defaults to `false` | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | ### org_name
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Set the organization name that should be used for anonymous users. If | 
					
						
							|  |  |  | you change your organization name in the Grafana UI this setting needs | 
					
						
							|  |  |  | to be updated to match the new name. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | ### org_role
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | Specify role for anonymous users. Defaults to `Viewer`, other valid | 
					
						
							|  |  |  | options are `Editor` and `Admin`. | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## [auth.github]
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | You need to create a GitHub application (you find this under the GitHub | 
					
						
							|  |  |  | profile page). When you create the application you will need to specify | 
					
						
							|  |  |  | a callback URL. Specify this as callback: | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     http://<my_grafana_server_name_or_ip>:<grafana_server_port>/login/github | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | This callback URL must match the full HTTP address that you use in your | 
					
						
							|  |  |  | browser to access Grafana, but with the prefix path of `/login/github`. | 
					
						
							|  |  |  | When the GitHub application is created you will get a Client ID and a | 
					
						
							|  |  |  | Client Secret. Specify these in the Grafana configuration file. For | 
					
						
							|  |  |  | example: | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     [auth.github] | 
					
						
							|  |  |  |     enabled = true | 
					
						
							|  |  |  |     client_id = YOUR_GITHUB_APP_CLIENT_ID | 
					
						
							|  |  |  |     client_secret = YOUR_GITHUB_APP_CLIENT_SECRET | 
					
						
							|  |  |  |     scopes = user:email | 
					
						
							|  |  |  |     auth_url = https://github.com/login/oauth/authorize | 
					
						
							|  |  |  |     token_url = https://github.com/login/oauth/access_token | 
					
						
							| 
									
										
										
										
											2015-04-10 09:15:19 +08:00
										 |  |  |     allow_sign_up = false | 
					
						
							| 
									
										
										
										
											2015-04-29 16:33:37 +08:00
										 |  |  |     team_ids = | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | Restart the Grafana back-end. You should now see a GitHub login button | 
					
						
							|  |  |  | on the login page. You can now login or sign up with your GitHub | 
					
						
							|  |  |  | accounts. | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | You may allow users to sign-up via GitHub authentication by setting the | 
					
						
							|  |  |  | `allow_sign_up` option to `true`. When this option is set to `true`, any | 
					
						
							|  |  |  | user successfully authenticating via GitHub authentication will be | 
					
						
							|  |  |  | automatically signed up. | 
					
						
							| 
									
										
										
										
											2015-04-10 09:15:19 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-29 16:33:37 +08:00
										 |  |  | ### team_ids
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Require an active team membership for at least one of the given teams on | 
					
						
							|  |  |  | GitHub.  If the authenticated user isn't a member of at least one the | 
					
						
							|  |  |  | teams they will not be able to register or authenticate with your | 
					
						
							|  |  |  | Grafana instance. For example: | 
					
						
							| 
									
										
										
										
											2015-04-29 16:33:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     [auth.github] | 
					
						
							|  |  |  |     enabled = true | 
					
						
							|  |  |  |     client_id = YOUR_GITHUB_APP_CLIENT_ID | 
					
						
							|  |  |  |     client_secret = YOUR_GITHUB_APP_CLIENT_SECRET | 
					
						
							|  |  |  |     scopes = user:email | 
					
						
							|  |  |  |     team_ids = 150,300 | 
					
						
							|  |  |  |     auth_url = https://github.com/login/oauth/authorize | 
					
						
							|  |  |  |     token_url = https://github.com/login/oauth/access_token | 
					
						
							|  |  |  |     allow_sign_up = false | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | ## [auth.google]
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | You need to create a Google project. You can do this in the [Google | 
					
						
							|  |  |  | Developer Console](https://console.developers.google.com/project).  When | 
					
						
							|  |  |  | you create the project you will need to specify a callback URL. Specify | 
					
						
							|  |  |  | this as callback: | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     http://<my_grafana_server_name_or_ip>:<grafana_server_port>/login/google | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | This callback URL must match the full HTTP address that you use in your | 
					
						
							|  |  |  | browser to access Grafana, but with the prefix path of `/login/google`. | 
					
						
							|  |  |  | When the Google project is created you will get a Client ID and a Client | 
					
						
							|  |  |  | Secret. Specify these in the Grafana configuration file. For example: | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     [auth.google] | 
					
						
							|  |  |  |     enabled = true | 
					
						
							|  |  |  |     client_id = YOUR_GOOGLE_APP_CLIENT_ID | 
					
						
							|  |  |  |     client_secret = YOUR_GOOGLE_APP_CLIENT_SECRET | 
					
						
							|  |  |  |     scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email | 
					
						
							|  |  |  |     auth_url = https://accounts.google.com/o/oauth2/auth | 
					
						
							|  |  |  |     token_url = https://accounts.google.com/o/oauth2/token | 
					
						
							| 
									
										
										
										
											2015-05-29 11:23:14 +08:00
										 |  |  |     allowed_domains = mycompany.com mycompany.org | 
					
						
							| 
									
										
										
										
											2015-04-10 09:15:19 +08:00
										 |  |  |     allow_sign_up = false | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | Restart the Grafana back-end. You should now see a Google login button | 
					
						
							|  |  |  | on the login page. You can now login or sign up with your Google | 
					
						
							| 
									
										
										
										
											2015-05-29 11:39:59 +08:00
										 |  |  | accounts. The `allowed_domains` option is optional, and domains were seperated by space. | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | You may allow users to sign-up via Google authentication by setting the | 
					
						
							|  |  |  | `allow_sign_up` option to `true`. When this option is set to `true`, any | 
					
						
							|  |  |  | user successfully authenticating via Google authentication will be | 
					
						
							|  |  |  | automatically signed up. | 
					
						
							| 
									
										
										
										
											2015-04-10 09:15:19 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-12 00:49:49 +08:00
										 |  |  | <hr> | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | ## [session]
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### provider
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Valid values are `memory`, `file`, `mysql`, `postgres`. Default is `file`. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### provider_config
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | This option should be configured differently depending on what type of | 
					
						
							|  |  |  | session provider you have configured. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | - **file:** session file path, e.g. `data/sessions` | 
					
						
							| 
									
										
										
										
											2015-03-27 00:55:07 +08:00
										 |  |  | - **mysql:** go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1)/database_name` | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | If you use MySQL or Postgres as the session store you need to create the | 
					
						
							|  |  |  | session table manually. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | Mysql Example: | 
					
						
							| 
									
										
										
										
											2015-03-12 01:13:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  |     CREATE TABLE `session` ( | 
					
						
							|  |  |  |         `key`       CHAR(16) NOT NULL, | 
					
						
							|  |  |  |         `data`      BLOB, | 
					
						
							|  |  |  |         `expiry`    INT(11) UNSIGNED NOT NULL, | 
					
						
							|  |  |  |         PRIMARY KEY (`key`) | 
					
						
							|  |  |  |     ) ENGINE=MyISAM DEFAULT CHARSET=utf8; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### cookie_name
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The name of the Grafana session cookie. | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### cookie_secure
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | Set to true if you host Grafana behind HTTPs only. Defaults to `false`. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### session_life_time
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-11 22:13:52 +08:00
										 |  |  | How long sessions lasts in seconds. Defaults to `86400` (24 hours). | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-30 15:22:58 +08:00
										 |  |  | ## [analytics]
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-30 23:39:16 +08:00
										 |  |  | ### reporting_enabled
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | When enabled Grafana will send anonymous usage statistics to `stats.grafana.org`. | 
					
						
							|  |  |  | No IP addresses are being tracked, only simple counters to track running instances, | 
					
						
							| 
									
										
										
										
											2015-03-30 15:22:58 +08:00
										 |  |  | versions, dashboard & error counts. It is very helpful to us, please leave this | 
					
						
							| 
									
										
										
										
											2015-04-22 23:44:47 +08:00
										 |  |  | enabled. Counters are sent every 24 hours. Default value is `true`. | 
					
						
							| 
									
										
										
										
											2015-03-30 15:22:58 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### google_analytics_ua_id
 | 
					
						
							| 
									
										
										
										
											2015-05-11 04:52:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | If you want to track Grafana usage via Google analytics specify *your* Universal Analytics ID | 
					
						
							|  |  |  | here. By default this feature is disabled. |