· 7 years ago · Sep 11, 2018, 01:38 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)
29;protocol = http
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
58;cert_file =
59;cert_key =
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")
203default_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# URL to redirect the user to after sign out
221;signout_redirect_url =
222
223#################################### Anonymous Auth ##########################
224[auth.anonymous]
225# enable anonymous access
226enabled = true
227
228# specify organization name that should be used for unauthenticated users
229org_name = ORGANIZATION
230
231# specify role for unauthenticated users
232org_role = Viewer
233
234#################################### Github Auth ##########################
235[auth.github]
236;enabled = false
237;allow_sign_up = true
238;client_id = some_id
239;client_secret = some_secret
240;scopes = user:email,read:org
241;auth_url = https://github.com/login/oauth/authorize
242;token_url = https://github.com/login/oauth/access_token
243;api_url = https://api.github.com/user
244;team_ids =
245;allowed_organizations =
246
247#################################### Google Auth ##########################
248[auth.google]
249;enabled = false
250;allow_sign_up = true
251;client_id = some_client_id
252;client_secret = some_client_secret
253;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
254;auth_url = https://accounts.google.com/o/oauth2/auth
255;token_url = https://accounts.google.com/o/oauth2/token
256;api_url = https://www.googleapis.com/oauth2/v1/userinfo
257;allowed_domains =
258
259#################################### Generic OAuth ##########################
260[auth.generic_oauth]
261;enabled = false
262;name = OAuth
263;allow_sign_up = true
264;client_id = some_id
265;client_secret = some_secret
266;scopes = user:email,read:org
267;auth_url = https://foo.bar/login/oauth/authorize
268;token_url = https://foo.bar/login/oauth/access_token
269;api_url = https://foo.bar/user
270;team_ids =
271;allowed_organizations =
272
273#################################### Grafana.com Auth ####################
274[auth.grafana_com]
275;enabled = false
276;allow_sign_up = true
277;client_id = some_id
278;client_secret = some_secret
279;scopes = user:email
280;allowed_organizations =
281
282#################################### Auth Proxy ##########################
283[auth.proxy]
284;enabled = false
285;header_name = X-WEBAUTH-USER
286;header_property = username
287;auto_sign_up = true
288;ldap_sync_ttl = 60
289;whitelist = 192.168.1.1, 192.168.2.1
290
291#################################### Basic Auth ##########################
292[auth.basic]
293;enabled = true
294
295#################################### Auth LDAP ##########################
296[auth.ldap]
297;enabled = false
298;config_file = /etc/grafana/ldap.toml
299;allow_sign_up = true
300
301#################################### SMTP / Emailing ##########################
302[smtp]
303;enabled = false
304;host = localhost:25
305;user =
306# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
307;password =
308;cert_file =
309;key_file =
310;skip_verify = false
311;from_address = admin@grafana.localhost
312;from_name = Grafana
313# EHLO identity in SMTP dialog (defaults to instance_name)
314;ehlo_identity = dashboard.example.com
315
316[emails]
317;welcome_email_on_sign_up = false
318
319#################################### Logging ##########################
320[log]
321# Either "console", "file", "syslog". Default is console and file
322# Use space to separate multiple modes, e.g. "console file"
323;mode = console file
324
325# Either "debug", "info", "warn", "error", "critical", default is "info"
326;level = info
327
328# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
329;filters =
330
331# For "console" mode only
332[log.console]
333;level =
334
335# log line format, valid options are text, console and json
336;format = console
337
338# For "file" mode only
339[log.file]
340;level =
341
342# log line format, valid options are text, console and json
343;format = text
344
345# This enables automated log rotate(switch of following options), default is true
346;log_rotate = true
347
348# Max line number of single file, default is 1000000
349;max_lines = 1000000
350
351# Max size shift of single file, default is 28 means 1 << 28, 256MB
352;max_size_shift = 28
353
354# Segment log daily, default is true
355;daily_rotate = true
356
357# Expired days of log file(delete after max days), default is 7
358;max_days = 7
359
360[log.syslog]
361;level =
362
363# log line format, valid options are text, console and json
364;format = text
365
366# Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
367;network =
368;address =
369
370# Syslog facility. user, daemon and local0 through local7 are valid.
371;facility =
372
373# Syslog tag. By default, the process' argv[0] is used.
374;tag =
375
376#################################### Alerting ############################
377[alerting]
378# Disable alerting engine & UI features
379;enabled = true
380# Makes it possible to turn off alert rule execution but alerting UI is visible
381;execute_alerts = true
382
383#################################### Explore #############################
384[explore]
385# Enable the Explore section
386;enabled = false
387
388#################################### Internal Grafana Metrics ##########################
389# Metrics available at HTTP API Url /metrics
390[metrics]
391# Disable / Enable internal metrics
392;enabled = true
393
394# Publish interval
395;interval_seconds = 10
396
397# Send internal metrics to Graphite
398[metrics.graphite]
399# Enable by setting the address setting (ex localhost:2003)
400;address =
401;prefix = prod.grafana.%(instance_name)s.
402
403#################################### Distributed tracing ############
404[tracing.jaeger]
405# Enable by setting the address sending traces to jaeger (ex localhost:6831)
406;address = localhost:6831
407# Tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
408;always_included_tag = tag1:value1
409# Type specifies the type of the sampler: const, probabilistic, rateLimiting, or remote
410;sampler_type = const
411# jaeger samplerconfig param
412# for "const" sampler, 0 or 1 for always false/true respectively
413# for "probabilistic" sampler, a probability between 0 and 1
414# for "rateLimiting" sampler, the number of spans per second
415# for "remote" sampler, param is the same as for "probabilistic"
416# and indicates the initial sampling rate before the actual one
417# is received from the mothership
418;sampler_param = 1
419
420#################################### Grafana.com integration ##########################
421# Url used to to import dashboards directly from Grafana.com
422[grafana_com]
423;url = https://grafana.com
424
425#################################### External image storage ##########################
426[external_image_storage]
427# Used for uploading images to public servers so they can be included in slack/email messages.
428# you can choose between (s3, webdav, gcs, azure_blob, local)
429;provider =
430
431[external_image_storage.s3]
432;bucket =
433;region =
434;path =
435;access_key =
436;secret_key =
437
438[external_image_storage.webdav]
439;url =
440;public_url =
441;username =
442;password =
443
444[external_image_storage.gcs]
445;key_file =
446;bucket =
447;path =
448
449[external_image_storage.azure_blob]
450;account_name =
451;account_key =
452;container_name =
453
454[external_image_storage.local]
455# does not require any configuration