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