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