· 9 years ago · Jan 31, 2017, 04:54 PM
1##################### Grafana Configuration Example #####################
2#
3# Everything has defaults so you only need to uncomment things you want to
4# change
5
6# possible values : production, development
7; app_mode = production
8
9# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
10; instance_name = ${HOSTNAME}
11
12#################################### Paths ####################################
13[paths]
14# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
15#
16;data = /var/lib/grafana
17#
18# Directory where grafana can store logs
19#
20;logs = /var/log/grafana
21#
22# Directory where grafana will automatically scan and look for plugins
23#
24;plugins = /var/lib/grafana/plugins
25
26#
27#################################### Server ####################################
28[server]
29# Protocol (http or https)
30;protocol = http
31
32# The ip address to bind to, empty will bind to all interfaces
33;http_addr =
34
35# The http port to use
36;http_port = 3000
37
38# The public facing domain name used to access grafana from a browser
39;domain = localhost
40
41# Redirect to correct domain if host header does not match domain
42# Prevents DNS rebinding attacks
43;enforce_domain = false
44
45# The full public facing url you use in browser, used for redirects and emails
46# If you use reverse proxy and sub path specify full url (with sub path)
47;root_url = http://localhost:3000
48
49# Log web requests
50;router_logging = false
51
52# the path relative working path
53;static_root_path = public
54
55# enable gzip
56;enable_gzip = false
57
58# https certs & key file
59;cert_file =
60;cert_key =
61
62#################################### Database ####################################
63[database]
64# You can configure the database connection by specifying type, host, name, user and password
65# as seperate properties or as on string using the url propertie.
66
67# Either "mysql", "postgres" or "sqlite3", it's your choice
68;type = sqlite3
69;host = 127.0.0.1:3306
70;name = grafana
71;user = root
72;password =
73
74# Use either URL or the previous fields to configure the database
75# Example: mysql://user:secret@host:port/database
76;url =
77
78# For "postgres" only, either "disable", "require" or "verify-full"
79;ssl_mode = disable
80
81# For "sqlite3" only, path relative to data_path setting
82;path = grafana.db
83
84#################################### Session ####################################
85[session]
86# Either "memory", "file", "redis", "mysql", "postgres", default is "file"
87;provider = file
88
89# Provider config options
90# memory: not have any config yet
91# file: session dir path, is relative to grafana data_path
92# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana`
93# mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1:3306)/database_name`
94# postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
95;provider_config = sessions
96
97# Session cookie name
98;cookie_name = grafana_sess
99
100# If you use session in https only, default is false
101;cookie_secure = false
102
103# Session life time, default is 86400
104;session_life_time = 86400
105
106#################################### Analytics ####################################
107[analytics]
108# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
109# No ip addresses are being tracked, only simple counters to track
110# running instances, dashboard and error counts. It is very helpful to us.
111# Change this option to false to disable reporting.
112;reporting_enabled = true
113
114# Set to false to disable all checks to https://grafana.net
115# for new vesions (grafana itself and plugins), check is used
116# in some UI views to notify that grafana or plugin update exists
117# This option does not cause any auto updates, nor send any information
118# only a GET request to http://grafana.net to get latest versions
119;check_for_updates = true
120
121# Google Analytics universal tracking code, only enabled if you specify an id here
122;google_analytics_ua_id =
123
124#################################### Security ####################################
125[security]
126# default admin user, created on startup
127;admin_user = admin
128
129# default admin password, can be changed before first start of grafana, or in profile settings
130;admin_password = admin
131
132# used for signing
133;secret_key = SW2YcwTIb9zpOOhoPsMm
134
135# Auto-login remember days
136;login_remember_days = 7
137;cookie_username = grafana_user
138;cookie_remember_name = grafana_remember
139
140# disable gravatar profile images
141;disable_gravatar = false
142
143# data source proxy whitelist (ip_or_domain:port separated by spaces)
144;data_source_proxy_whitelist =
145
146[snapshots]
147# snapshot sharing options
148;external_enabled = true
149;external_snapshot_url = https://snapshots-origin.raintank.io
150;external_snapshot_name = Publish to snapshot.raintank.io
151
152# remove expired snapshot
153;snapshot_remove_expired = true
154
155# remove snapshots after 90 days
156;snapshot_TTL_days = 90
157
158#################################### Users ####################################
159[users]
160# disable user signup / registration
161;allow_sign_up = true
162
163# Allow non admin users to create organizations
164;allow_org_create = true
165
166# Set to true to automatically assign new users to the default organization (id 1)
167;auto_assign_org = true
168
169# Default role new users will be automatically assigned (if disabled above is set to true)
170;auto_assign_org_role = Viewer
171
172# Background text for the user field on the login page
173;login_hint = email or username
174
175# Default UI theme ("dark" or "light")
176;default_theme = dark
177
178[auth]
179# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
180;disable_login_form = false
181
182#################################### Anonymous Auth ##########################
183[auth.anonymous]
184# enable anonymous access
185;enabled = false
186
187# specify organization name that should be used for unauthenticated users
188;org_name = Main Org.
189
190# specify role for unauthenticated users
191;org_role = Viewer
192
193#################################### Github Auth ##########################
194[auth.github]
195;enabled = false
196;allow_sign_up = false
197;client_id = some_id
198;client_secret = some_secret
199;scopes = user:email,read:org
200;auth_url = https://github.com/login/oauth/authorize
201;token_url = https://github.com/login/oauth/access_token
202;api_url = https://api.github.com/user
203;team_ids =
204;allowed_organizations =
205
206#################################### Google Auth ##########################
207[auth.google]
208;enabled = false
209;allow_sign_up = false
210;client_id = some_client_id
211;client_secret = some_client_secret
212;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
213;auth_url = https://accounts.google.com/o/oauth2/auth
214;token_url = https://accounts.google.com/o/oauth2/token
215;api_url = https://www.googleapis.com/oauth2/v1/userinfo
216;allowed_domains =
217
218#################################### Generic OAuth ##########################
219[auth.generic_oauth]
220;enabled = false
221;allow_sign_up = false
222;client_id = some_id
223;client_secret = some_secret
224;scopes = user:email,read:org
225;auth_url = https://foo.bar/login/oauth/authorize
226;token_url = https://foo.bar/login/oauth/access_token
227;api_url = https://foo.bar/user
228;team_ids =
229;allowed_organizations =
230
231#################################### Grafana.net Auth ####################
232[auth.grafananet]
233;enabled = false
234;allow_sign_up = false
235;client_id = some_id
236;client_secret = some_secret
237;scopes = user:email
238;allowed_organizations =
239
240#################################### Auth Proxy ##########################
241[auth.proxy]
242;enabled = false
243;header_name = X-WEBAUTH-USER
244;header_property = username
245;auto_sign_up = true
246
247#################################### Basic Auth ##########################
248[auth.basic]
249;enabled = true
250
251#################################### Auth LDAP ##########################
252[auth.ldap]
253;enabled = false
254;config_file = /etc/grafana/ldap.toml
255;allow_sign_up = true
256
257#################################### SMTP / Emailing ##########################
258[smtp]
259enabled = true
260host = smtp.gmail.com:587
261user = flummigitlab@gmail.com
262password = XXXXXXXXXXXXXXXXXXXXXXXXX
263;cert_file =
264;key_file =
265;skip_verify = false
266from_address = flummigitlab@gmail.com
267
268[emails]
269;welcome_email_on_sign_up = false
270
271#################################### Logging ##########################
272[log]
273# Either "console", "file", "syslog". Default is console and file
274# Use space to separate multiple modes, e.g. "console file"
275;mode = console, file
276
277# Either "trace", "debug", "info", "warn", "error", "critical", default is "info"
278;level = info
279
280# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
281;filters =
282
283
284# For "console" mode only
285[log.console]
286;level =
287
288# log line format, valid options are text, console and json
289;format = console
290
291# For "file" mode only
292[log.file]
293;level =
294
295# log line format, valid options are text, console and json
296;format = text
297
298# This enables automated log rotate(switch of following options), default is true
299;log_rotate = true
300
301# Max line number of single file, default is 1000000
302;max_lines = 1000000
303
304# Max size shift of single file, default is 28 means 1 << 28, 256MB
305;max_size_shift = 28
306
307# Segment log daily, default is true
308;daily_rotate = true
309
310# Expired days of log file(delete after max days), default is 7
311;max_days = 7
312
313[log.syslog]
314;level =
315
316# log line format, valid options are text, console and json
317;format = text
318
319# Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
320;network =
321;address =
322
323# Syslog facility. user, daemon and local0 through local7 are valid.
324;facility =
325
326# Syslog tag. By default, the process' argv[0] is used.
327;tag =
328
329
330#################################### AMQP Event Publisher ##########################
331[event_publisher]
332;enabled = false
333;rabbitmq_url = amqp://localhost/
334;exchange = grafana_events
335
336;#################################### Dashboard JSON files ##########################
337[dashboards.json]
338;enabled = false
339;path = /var/lib/grafana/dashboards
340
341#################################### Alerting ######################################
342[alerting]
343# Makes it possible to turn off alert rule execution.
344;execute_alerts = true
345
346#################################### Internal Grafana Metrics ##########################
347# Metrics available at HTTP API Url /api/metrics
348[metrics]
349# Disable / Enable internal metrics
350;enabled = true
351
352# Publish interval
353;interval_seconds = 10
354
355# Send internal metrics to Graphite
356[metrics.graphite]
357# Enable by setting the address setting (ex localhost:2003)
358;address =
359;prefix = prod.grafana.%(instance_name)s.
360
361#################################### Internal Grafana Metrics ##########################
362# Url used to to import dashboards directly from Grafana.net
363[grafana_net]
364;url = https://grafana.net
365
366#################################### External image storage ##########################
367[external_image_storage]
368# Used for uploading images to public servers so they can be included in slack/email messages.
369# you can choose between (s3, webdav)
370;provider =
371
372[external_image_storage.s3]
373;bucket_url =
374;access_key =
375;secret_key =
376
377[external_image_storage.webdav]
378;url =
379;username =
380;password =