grafana.conf.j2 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. app_mode = production
  2. instance_name = ${HOSTNAME}
  3. [paths]
  4. data = /var/db/grafana/
  5. temp_data_lifetime = 24h
  6. logs = /var/log/grafana/
  7. plugins = /var/db/grafana/plugins
  8. provisioning = /var/db/grafana/provisioning
  9. #################################### Server ####################################
  10. [server]
  11. protocol = http
  12. domain = grafana.local
  13. ;enforce_domain = false
  14. ;router_logging = false
  15. #################################### Database ############################
  16. [database]
  17. # You can configure the database connection by specifying type, host, name, user and password
  18. # as separate properties or as on string using the url property.
  19. # Either "mysql", "postgres" or "sqlite3", it's your choice
  20. type = postgres
  21. host = db.local
  22. name = grafana
  23. user = grafana
  24. password = {{ grafana_db_pass }}
  25. log_queries =
  26. #################################### Cache server #############################
  27. [remote_cache]
  28. # Either "redis", "memcached" or "database" default is "database"
  29. type = redis
  30. connstr = addr=127.0.0.1:6379,pool_size=100,db=0,ssl=false
  31. #################################### Analytics ###########################
  32. [analytics]
  33. reporting_enabled = true
  34. check_for_updates = true
  35. #################################### Security ############################
  36. [security]
  37. admin_user = secstate
  38. admin_password = {{ grafana_admin_pass }}
  39. #################################### Users ###############################
  40. [users]
  41. allow_sign_up = false
  42. allow_org_create = false
  43. #################################### Anonymous Auth ######################
  44. [auth.anonymous]
  45. enabled = true
  46. org_name = GAnon
  47. org_role = Viewer
  48. #################################### Github Auth #########################
  49. [auth.github]
  50. ;enabled = false
  51. ;allow_sign_up = true
  52. ;client_id = some_id
  53. ;client_secret = some_secret
  54. ;scopes = user:email,read:org
  55. ;auth_url = https://github.com/login/oauth/authorize
  56. ;token_url = https://github.com/login/oauth/access_token
  57. ;api_url = https://api.github.com/user
  58. ;allowed_domains =
  59. ;team_ids =
  60. ;allowed_organizations =
  61. #################################### GitLab Auth #########################
  62. [auth.gitlab]
  63. ;enabled = false
  64. ;allow_sign_up = true
  65. ;client_id = some_id
  66. ;client_secret = some_secret
  67. ;scopes = api
  68. ;auth_url = https://gitlab.com/oauth/authorize
  69. ;token_url = https://gitlab.com/oauth/token
  70. ;api_url = https://gitlab.com/api/v4
  71. ;allowed_domains =
  72. ;allowed_groups =
  73. #################################### Google Auth #########################
  74. [auth.google]
  75. ;enabled = false
  76. ;allow_sign_up = true
  77. ;client_id = some_client_id
  78. ;client_secret = some_client_secret
  79. ;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
  80. ;auth_url = https://accounts.google.com/o/oauth2/auth
  81. ;token_url = https://accounts.google.com/o/oauth2/token
  82. ;api_url = https://www.googleapis.com/oauth2/v1/userinfo
  83. ;allowed_domains =
  84. ;hosted_domain =
  85. #################################### Grafana.com Auth ####################
  86. # legacy key names (so they work in env variables)
  87. [auth.grafananet]
  88. ;enabled = false
  89. ;allow_sign_up = true
  90. ;client_id = some_id
  91. ;client_secret = some_secret
  92. ;scopes = user:email
  93. ;allowed_organizations =
  94. [auth.grafana_com]
  95. ;enabled = false
  96. ;allow_sign_up = true
  97. ;client_id = some_id
  98. ;client_secret = some_secret
  99. ;scopes = user:email
  100. ;allowed_organizations =
  101. #################################### Azure AD OAuth #######################
  102. [auth.azuread]
  103. ;name = Azure AD
  104. ;enabled = false
  105. ;allow_sign_up = true
  106. ;client_id = some_client_id
  107. ;client_secret = some_client_secret
  108. ;scopes = openid email profile
  109. ;auth_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize
  110. ;token_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
  111. ;allowed_domains =
  112. ;allowed_groups =
  113. #################################### Okta OAuth #######################
  114. [auth.okta]
  115. ;name = Okta
  116. ;enabled = false
  117. ;allow_sign_up = true
  118. ;client_id = some_id
  119. ;client_secret = some_secret
  120. ;scopes = openid profile email groups
  121. ;auth_url = https://<tenant-id>.okta.com/oauth2/v1/authorize
  122. ;token_url = https://<tenant-id>.okta.com/oauth2/v1/token
  123. ;api_url = https://<tenant-id>.okta.com/oauth2/v1/userinfo
  124. ;allowed_domains =
  125. ;allowed_groups =
  126. ;role_attribute_path =
  127. #################################### Generic OAuth #######################
  128. [auth.generic_oauth]
  129. ;name = OAuth
  130. ;enabled = false
  131. ;allow_sign_up = true
  132. ;client_id = some_id
  133. ;client_secret = some_secret
  134. ;scopes = user:email
  135. ;email_attribute_name = email:primary
  136. ;email_attribute_path =
  137. ;role_attribute_path =
  138. ;auth_url =
  139. ;token_url =
  140. ;api_url =
  141. ;allowed_domains =
  142. ;team_ids =
  143. ;allowed_organizations =
  144. ;tls_skip_verify_insecure = false
  145. ;tls_client_cert =
  146. ;tls_client_key =
  147. ;tls_client_ca =
  148. #################################### Basic Auth ##########################
  149. [auth.basic]
  150. ;enabled = true
  151. #################################### Auth Proxy ##########################
  152. [auth.proxy]
  153. ;enabled = false
  154. ;header_name = X-WEBAUTH-USER
  155. ;header_property = username
  156. ;auto_sign_up = true
  157. # Deprecated, use sync_ttl instead
  158. ;ldap_sync_ttl = 60
  159. ;sync_ttl = 60
  160. ;whitelist =
  161. ;headers =
  162. ;enable_login_token = false
  163. #################################### Auth LDAP ###########################
  164. [auth.ldap]
  165. ;enabled = false
  166. ;config_file = /etc/grafana/ldap.toml
  167. ;allow_sign_up = true
  168. # LDAP backround sync (Enterprise only)
  169. # At 1 am every day
  170. ;sync_cron = "0 0 1 * * *"
  171. ;active_sync_enabled = true
  172. #################################### SMTP / Emailing #####################
  173. [smtp]
  174. ;enabled = false
  175. ;host = localhost:25
  176. ;user =
  177. # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
  178. ;password =
  179. ;cert_file =
  180. ;key_file =
  181. ;skip_verify = false
  182. ;from_address = admin@grafana.localhost
  183. ;from_name = Grafana
  184. ;ehlo_identity =
  185. [emails]
  186. ;welcome_email_on_sign_up = false
  187. ;templates_pattern = emails/*.html
  188. #################################### Logging ##########################
  189. [log]
  190. # Either "console", "file", "syslog". Default is console and file
  191. # Use space to separate multiple modes, e.g. "console file"
  192. ;mode = console file
  193. # Either "debug", "info", "warn", "error", "critical", default is "info"
  194. ;level = info
  195. # optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
  196. ;filters =
  197. # For "console" mode only
  198. [log.console]
  199. ;level =
  200. # log line format, valid options are text, console and json
  201. ;format = console
  202. # For "file" mode only
  203. [log.file]
  204. level = info
  205. format = json
  206. log_rotate = true
  207. ;max_lines = 1000000
  208. max_days = 14
  209. [log.syslog]
  210. ;level =
  211. # log line format, valid options are text, console and json
  212. ;format = text
  213. # Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
  214. ;network =
  215. ;address =
  216. # Syslog facility. user, daemon and local0 through local7 are valid.
  217. ;facility =
  218. # Syslog tag. By default, the process' argv[0] is used.
  219. ;tag =
  220. #################################### Usage Quotas ########################
  221. [quota]
  222. ;enabled = false
  223. #### set quotas to -1 to make unlimited. ####
  224. # limit number of users per Org.
  225. ;org_user = 10
  226. # limit number of dashboards per Org.
  227. ;org_dashboard = 100
  228. # limit number of data_sources per Org.
  229. ;org_data_source = 10
  230. # limit number of api_keys per Org.
  231. ;org_api_key = 10
  232. # limit number of orgs a user can create.
  233. ;user_org = 10
  234. # Global limit of users.
  235. ;global_user = -1
  236. # global limit of orgs.
  237. ;global_org = -1
  238. # global limit of dashboards
  239. ;global_dashboard = -1
  240. # global limit of api_keys
  241. ;global_api_key = -1
  242. # global limit on number of logged in users.
  243. ;global_session = -1
  244. #################################### Alerting ############################
  245. [alerting]
  246. # Disable alerting engine & UI features
  247. ;enabled = true
  248. # Makes it possible to turn off alert rule execution but alerting UI is visible
  249. ;execute_alerts = true
  250. # Default setting for new alert rules. Defaults to categorize error and timeouts as alerting. (alerting, keep_state)
  251. ;error_or_timeout = alerting
  252. # Default setting for how Grafana handles nodata or null values in alerting. (alerting, no_data, keep_state, ok)
  253. ;nodata_or_nullvalues = no_data
  254. # Alert notifications can include images, but rendering many images at the same time can overload the server
  255. # This limit will protect the server from render overloading and make sure notifications are sent out quickly
  256. ;concurrent_render_limit = 5
  257. # Default setting for alert calculation timeout. Default value is 30
  258. ;evaluation_timeout_seconds = 30
  259. # Default setting for alert notification timeout. Default value is 30
  260. ;notification_timeout_seconds = 30
  261. # Default setting for max attempts to sending alert notifications. Default value is 3
  262. ;max_attempts = 3
  263. # Makes it possible to enforce a minimal interval between evaluations, to reduce load on the backend
  264. ;min_interval_seconds = 1
  265. #################################### Explore #############################
  266. [explore]
  267. # Enable the Explore section
  268. ;enabled = true
  269. #################################### Internal Grafana Metrics ############
  270. # Metrics available at HTTP API Url /metrics
  271. [metrics]
  272. ;enabled = true
  273. ;interval_seconds = 10
  274. # Disable total stats (stat_totals_*) metrics to be generated
  275. ;disable_total_stats = false
  276. #If both are set, basic auth will be required for the metrics endpoint.
  277. ;basic_auth_username =
  278. ;basic_auth_password =
  279. # Send internal Grafana metrics to graphite
  280. [metrics.graphite]
  281. # Enable by setting the address setting (ex localhost:2003)
  282. ;address =
  283. ;prefix = prod.grafana.%(instance_name)s.
  284. #################################### Grafana.com integration ##########################
  285. [grafana_net]
  286. ;url = https://grafana.com
  287. [grafana_com]
  288. ;url = https://grafana.com
  289. #################################### Distributed tracing ############
  290. [tracing.jaeger]
  291. # jaeger destination (ex localhost:6831)
  292. ;address =
  293. # tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
  294. ;always_included_tag =
  295. # Type specifies the type of the sampler: const, probabilistic, rateLimiting, or remote
  296. ;sampler_type = const
  297. # jaeger samplerconfig param
  298. # for "const" sampler, 0 or 1 for always false/true respectively
  299. # for "probabilistic" sampler, a probability between 0 and 1
  300. # for "rateLimiting" sampler, the number of spans per second
  301. # for "remote" sampler, param is the same as for "probabilistic"
  302. # and indicates the initial sampling rate before the actual one
  303. # is received from the mothership
  304. ;sampler_param = 1
  305. # Whether or not to use Zipkin span propagation (x-b3- HTTP headers).
  306. ;zipkin_propagation = false
  307. # Setting this to true disables shared RPC spans.
  308. # Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
  309. ;disable_shared_zipkin_spans = false
  310. #################################### External Image Storage ##############
  311. [external_image_storage]
  312. # Used for uploading images to public servers so they can be included in slack/email messages.
  313. # You can choose between (s3, webdav, gcs, azure_blob, local)
  314. ;provider =
  315. [external_image_storage.s3]
  316. ;endpoint =
  317. ;path_style_access =
  318. ;bucket_url =
  319. ;bucket =
  320. ;region =
  321. ;path =
  322. ;access_key =
  323. ;secret_key =
  324. [external_image_storage.webdav]
  325. ;url =
  326. ;username =
  327. ;password =
  328. ;public_url =
  329. [external_image_storage.gcs]
  330. ;key_file =
  331. ;bucket =
  332. ;path =
  333. [external_image_storage.azure_blob]
  334. ;account_name =
  335. ;account_key =
  336. ;container_name =
  337. [external_image_storage.local]
  338. # does not require any configuration
  339. [rendering]
  340. # Options to configure a remote HTTP image rendering service, e.g. using https://github.com/grafana/grafana-image-renderer.
  341. # URL to a remote HTTP image renderer service, e.g. http://localhost:8081/render, will enable Grafana to render panels and dashboards to PNG-images using HTTP requests to an external service.
  342. ;server_url =
  343. # If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
  344. ;callback_url =
  345. # Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
  346. # which this setting can help protect against by only allowing a certain amount of concurrent requests.
  347. ;concurrent_render_request_limit = 30
  348. [panels]
  349. # here for to support old env variables, can remove after a few months
  350. ;enable_alpha = false
  351. ;disable_sanitize_html = false
  352. [plugins]
  353. ;enable_alpha = false
  354. ;app_tls_skip_verify_insecure = false
  355. # Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
  356. ;allow_loading_unsigned_plugins =
  357. #################################### Grafana Image Renderer Plugin ##########################
  358. [plugin.grafana-image-renderer]
  359. # Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
  360. # See ICU’s metaZones.txt (https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt) for a list of supported
  361. # timezone IDs. Fallbacks to TZ environment variable if not set.
  362. ;rendering_timezone =
  363. # Instruct headless browser instance to use a default language when not provided by Grafana, e.g. when rendering panel image of alert.
  364. # Please refer to the HTTP header Accept-Language to understand how to format this value, e.g. 'fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5'.
  365. ;rendering_language =
  366. # Instruct headless browser instance to use a default device scale factor when not provided by Grafana, e.g. when rendering panel image of alert.
  367. # Default is 1. Using a higher value will produce more detailed images (higher DPI), but will require more disk space to store an image.
  368. ;rendering_viewport_device_scale_factor =
  369. # Instruct headless browser instance whether to ignore HTTPS errors during navigation. Per default HTTPS errors are not ignored. Due to
  370. # the security risk it's not recommended to ignore HTTPS errors.
  371. ;rendering_ignore_https_errors =
  372. # Instruct headless browser instance whether to capture and log verbose information when rendering an image. Default is false and will
  373. # only capture and log error messages. When enabled, debug messages are captured and logged as well.
  374. # For the verbose information to be included in the Grafana server log you have to adjust the rendering log level to debug, configure
  375. # [log].filter = rendering:debug.
  376. ;rendering_verbose_logging =
  377. # Instruct headless browser instance whether to output its debug and error messages into running process of remote rendering service.
  378. # Default is false. This can be useful to enable (true) when troubleshooting.
  379. ;rendering_dumpio =
  380. # Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found
  381. # here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character.
  382. ;rendering_args =
  383. # You can configure the plugin to use a different browser binary instead of the pre-packaged version of Chromium.
  384. # Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
  385. # compatible with the plugin.
  386. ;rendering_chrome_bin =
  387. # Instruct how headless browser instances are created. Default is 'default' and will create a new browser instance on each request.
  388. # Mode 'clustered' will make sure that only a maximum of browsers/incognito pages can execute concurrently.
  389. # Mode 'reusable' will have one browser instance and will create a new incognito page on each request.
  390. ;rendering_mode =
  391. # When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
  392. # and will cluster using browser instances.
  393. # Mode 'context' will cluster using incognito pages.
  394. ;rendering_clustering_mode =
  395. # When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
  396. ;rendering_clustering_max_concurrency =
  397. # Limit the maxiumum viewport width, height and device scale factor that can be requested.
  398. ;rendering_viewport_max_width =
  399. ;rendering_viewport_max_height =
  400. ;rendering_viewport_max_device_scale_factor =
  401. # Change the listening host and port of the gRPC server. Default host is 127.0.0.1 and default port is 0 and will automatically assign
  402. # a port not in use.
  403. ;grpc_host =
  404. ;grpc_port =
  405. [enterprise]
  406. ;license_path =
  407. [feature_toggles]
  408. # enable features, separated by spaces
  409. ;enable =