grafana.conf.j2 16 KB

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