· 7 years ago · Oct 12, 2018, 12:24 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;data = /var/lib/grafana
16
17# Directory where grafana can store logs
18;logs = /var/log/grafana
19
20# Directory where grafana will automatically scan and look for plugins
21;plugins = /var/lib/grafana/plugins
22
23# folder that contains provisioning config files that grafana will apply on startup and while running.
24;provisioning = conf/provisioning
25
26#################################### Server ####################################
27[server]
28# Protocol (http, https, socket)
29protocol = https
30
31# The ip address to bind to, empty will bind to all interfaces
32;http_addr =
33
34# The http port to use
35;http_port = 3000
36
37# The public facing domain name used to access grafana from a browser
38;domain = localhost
39
40# Redirect to correct domain if host header does not match domain
41# Prevents DNS rebinding attacks
42;enforce_domain = false
43
44# The full public facing url you use in browser, used for redirects and emails
45# If you use reverse proxy and sub path specify full url (with sub path)
46;root_url = http://localhost:3000
47
48# Log web requests
49;router_logging = false
50
51# the path relative working path
52;static_root_path = public
53
54# enable gzip
55;enable_gzip = false
56
57# https certs & key file
58cert_file = /etc/grafana/cert.pem
59cert_key = /etc/grafana/key.pem
60
61# Unix socket path
62;socket =
63
64#################################### Database ####################################
65[database]
66# You can configure the database connection by specifying type, host, name, user and password
67# as separate properties or as on string using the url properties.
68
69# Either "mysql", "postgres" or "sqlite3", it's your choice
70;type = sqlite3
71;host = 127.0.0.1:3306
72;name = grafana
73;user = root
74# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
75;password =
76
77# Use either URL or the previous fields to configure the database
78# Example: mysql://user:secret@host:port/database
79;url =
80
81# For "postgres" only, either "disable", "require" or "verify-full"
82;ssl_mode = disable
83
84# For "sqlite3" only, path relative to data_path setting
85;path = grafana.db
86
87# Max idle conn setting default is 2
88;max_idle_conn = 2
89
90# Max conn setting default is 0 (mean not set)
91;max_open_conn =
92
93# Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours)
94;conn_max_lifetime = 14400
95
96# Set to true to log the sql calls and execution times.
97log_queries =
98
99#################################### Session ####################################
100[session]
101# Either "memory", "file", "redis", "mysql", "postgres", default is "file"
102;provider = file
103
104# Provider config options
105# memory: not have any config yet
106# file: session dir path, is relative to grafana data_path
107# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana`
108# mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1:3306)/database_name`
109# postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
110;provider_config = sessions
111
112# Session cookie name
113;cookie_name = grafana_sess
114
115# If you use session in https only, default is false
116;cookie_secure = false
117
118# Session life time, default is 86400
119;session_life_time = 86400
120
121#################################### Data proxy ###########################
122[dataproxy]
123
124# This enables data proxy logging, default is false
125;logging = false
126
127#################################### Analytics ####################################
128[analytics]
129# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
130# No ip addresses are being tracked, only simple counters to track
131# running instances, dashboard and error counts. It is very helpful to us.
132# Change this option to false to disable reporting.
133;reporting_enabled = true
134
135# Set to false to disable all checks to https://grafana.net
136# for new vesions (grafana itself and plugins), check is used
137# in some UI views to notify that grafana or plugin update exists
138# This option does not cause any auto updates, nor send any information
139# only a GET request to http://grafana.com to get latest versions
140;check_for_updates = true
141
142# Google Analytics universal tracking code, only enabled if you specify an id here
143;google_analytics_ua_id =
144
145#################################### Security ####################################
146[security]
147# default admin user, created on startup
148;admin_user = admin
149
150# default admin password, can be changed before first start of grafana, or in profile settings
151;admin_password = admin
152
153# used for signing
154;secret_key = SW2YcwTIb9zpOOhoPsMm
155
156# Auto-login remember days
157;login_remember_days = 7
158;cookie_username = grafana_user
159;cookie_remember_name = grafana_remember
160
161# disable gravatar profile images
162;disable_gravatar = false
163
164# data source proxy whitelist (ip_or_domain:port separated by spaces)
165;data_source_proxy_whitelist =
166
167# disable protection against brute force login attempts
168;disable_brute_force_login_protection = false
169
170#################################### Snapshots ###########################
171[snapshots]
172# snapshot sharing options
173;external_enabled = true
174;external_snapshot_url = https://snapshots-origin.raintank.io
175;external_snapshot_name = Publish to snapshot.raintank.io
176
177# remove expired snapshot
178;snapshot_remove_expired = true
179
180#################################### Dashboards History ##################
181[dashboards]
182# Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1
183;versions_to_keep = 20
184
185#################################### Users ###############################
186[users]
187# disable user signup / registration
188;allow_sign_up = true
189
190# Allow non admin users to create organizations
191;allow_org_create = true
192
193# Set to true to automatically assign new users to the default organization (id 1)
194;auto_assign_org = true
195
196# Default role new users will be automatically assigned (if disabled above is set to true)
197;auto_assign_org_role = Viewer
198
199# Background text for the user field on the login page
200;login_hint = email or username
201
202# Default UI theme ("dark" or "light")
203;default_theme = dark
204
205# External user management, these options affect the organization users view
206;external_manage_link_url =
207;external_manage_link_name =
208;external_manage_info =
209
210# Viewers can edit/inspect dashboard settings in the browser. But not save the dashboard.
211;viewers_can_edit = false
212
213[auth]
214# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
215;disable_login_form = false
216
217# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
218;disable_signout_menu = false
219
220#################################### Anonymous Auth ##########################
221[auth.anonymous]
222# enable anonymous access
223;enabled = false
224
225# specify organization name that should be used for unauthenticated users
226;org_name = Main Org.
227
228# specify role for unauthenticated users
229;org_role = Viewer
230
231#################################### Github Auth ##########################
232[auth.github]
233;enabled = false
234;allow_sign_up = true
235;client_id = some_id
236;client_secret = some_secret
237;scopes = user:email,read:org
238;auth_url = https://github.com/login/oauth/authorize
239;token_url = https://github.com/login/oauth/access_token
240;api_url = https://api.github.com/user
241;team_ids =
242;allowed_organizations =
243
244#################################### Google Auth ##########################
245[auth.google]
246;enabled = false
247;allow_sign_up = true
248;client_id = some_client_id
249;client_secret = some_client_secret
250;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
251;auth_url = https://accounts.google.com/o/oauth2/auth
252;token_url = https://accounts.google.com/o/oauth2/token
253;api_url = https://www.googleapis.com/oauth2/v1/userinfo
254;allowed_domains =
255
256#################################### Generic OAuth ##########################
257[auth.generic_oauth]
258;enabled = false
259;name = OAuth
260;allow_sign_up = true
261;client_id = some_id
262;client_secret = some_secret
263;scopes = user:email,read:org
264;auth_url = https://foo.bar/login/oauth/authorize
265;token_url = https://foo.bar/login/oauth/access_token
266;api_url = https://foo.bar/user
267;team_ids =
268;allowed_organizations =
269
270#################################### Grafana.com Auth ####################
271[auth.grafana_com]
272;enabled = false
273;allow_sign_up = true
274;client_id = some_id
275;client_secret = some_secret
276;scopes = user:email
277;allowed_organizations =
278
279#################################### Auth Proxy ##########################
280[auth.proxy]
281;enabled = false
282;header_name = X-WEBAUTH-USER
283;header_property = username
284;auto_sign_up = true
285;ldap_sync_ttl = 60
286;whitelist = 192.168.1.1, 192.168.2.1
287
288#################################### Basic Auth ##########################
289[auth.basic]
290;enabled = true
291
292#################################### Auth LDAP ##########################
293[auth.ldap]
294;enabled = false
295;config_file = /etc/grafana/ldap.toml
296;allow_sign_up = true
297
298#################################### SMTP / Emailing ##########################
299[smtp]
300;enabled = false
301;host = localhost:25
302;user =
303# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
304;password =
305;cert_file =
306;key_file =
307;skip_verify = false
308;from_address = admin@grafana.localhost
309;from_name = Grafana
310# EHLO identity in SMTP dialog (defaults to instance_name)
311;ehlo_identity = dashboard.example.com
312
313[emails]
314;welcome_email_on_sign_up = false
315
316#################################### Logging ##########################
317[log]
318# Either "console", "file", "syslog". Default is console and file
319# Use space to separate multiple modes, e.g. "console file"
320;mode = console file
321
322# Either "debug", "info", "warn", "error", "critical", default is "info"
323;level = info
324
325# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
326;filters =
327
328# For "console" mode only
329[log.console]
330;level =
331
332# log line format, valid options are text, console and json
333;format = console
334
335# For "file" mode only
336[log.file]
337;level =
338
339# log line format, valid options are text, console and json
340;format = text
341
342# This enables automated log rotate(switch of following options), default is true
343;log_rotate = true
344
345# Max line number of single file, default is 1000000
346;max_lines = 1000000
347
348# Max size shift of single file, default is 28 means 1 << 28, 256MB
349;max_size_shift = 28
350
351# Segment log daily, default is true
352;daily_rotate = true
353
354# Expired days of log file(delete after max days), default is 7
355;max_days = 7
356
357[log.syslog]
358;level =
359
360# log line format, valid options are text, console and json
361;format = text
362
363# Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
364;network =
365;address =
366
367# Syslog facility. user, daemon and local0 through local7 are valid.
368;facility =
369
370# Syslog tag. By default, the process' argv[0] is used.
371;tag =
372
373#################################### Alerting ############################
374[alerting]
375# Disable alerting engine & UI features
376;enabled = true
377# Makes it possible to turn off alert rule execution but alerting UI is visible
378;execute_alerts = true
379
380#################################### Internal Grafana Metrics ##########################
381# Metrics available at HTTP API Url /metrics
382[metrics]
383# Disable / Enable internal metrics
384;enabled = true
385
386# Publish interval
387;interval_seconds = 10
388
389# Send internal metrics to Graphite
390[metrics.graphite]
391# Enable by setting the address setting (ex localhost:2003)
392;address =
393;prefix = prod.grafana.%(instance_name)s.
394
395#################################### Distributed tracing ############
396[tracing.jaeger]
397# Enable by setting the address sending traces to jaeger (ex localhost:6831)
398;address = localhost:6831
399# Tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
400;always_included_tag = tag1:value1
401# Type specifies the type of the sampler: const, probabilistic, rateLimiting, or remote
402;sampler_type = const
403# jaeger samplerconfig param
404# for "const" sampler, 0 or 1 for always false/true respectively
405# for "probabilistic" sampler, a probability between 0 and 1
406# for "rateLimiting" sampler, the number of spans per second
407# for "remote" sampler, param is the same as for "probabilistic"
408# and indicates the initial sampling rate before the actual one
409# is received from the mothership
410;sampler_param = 1
411
412#################################### Grafana.com integration ##########################
413# Url used to to import dashboards directly from Grafana.com
414[grafana_com]
415;url = https://grafana.com
416
417#################################### External image storage ##########################
418[external_image_storage]
419# Used for uploading images to public servers so they can be included in slack/email messages.
420# you can choose between (s3, webdav, gcs, azure_blob, local)
421;provider =
422
423[external_image_storage.s3]
424;bucket =
425;region =
426;path =
427;access_key =
428;secret_key =
429
430[external_image_storage.webdav]
431;url =
432;public_url =
433;username =
434;password =
435
436[external_image_storage.gcs]
437;key_file =
438;bucket =
439;path =
440
441[external_image_storage.azure_blob]
442;account_name =
443;account_key =
444;container_name =
445
446[external_image_storage.local]
447# does not require any configuration