当前位置:   article > 正文

宝塔手动安装grafana

宝塔手动安装grafana

1.下载

  1. # 进入目标目录
  2. cd /data/prometheus/
  3. # 下载
  4. wget https://dl.grafana.com/oss/release/grafana-8.0.4-1.x86_64.rpm
  5. # 安装
  6. sudo yum install grafana-8.0.4-1.x86_64.rpm

2.运行项目

  1. # 启动
  2. /etc/init.d/grafana-server start

3.修改配置文件全局搜索 defaults.ini

/usr/share/grafana/conf/defaults.ini

修改配置为:

  1. ##################### Grafana Configuration Example #####################
  2. #
  3. # Everything has defaults so you only need to uncomment things you want to
  4. # change
  5. # possible values : production, development
  6. ;app_mode = production
  7. # instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
  8. ;instance_name = ${HOSTNAME}
  9. #################################### Paths ####################################
  10. [paths]
  11. # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
  12. ;data = /var/lib/grafana
  13. # Temporary files in `data` directory older than given duration will be removed
  14. ;temp_data_lifetime = 24h
  15. # Directory where grafana can store logs
  16. ;logs = /var/log/grafana
  17. # Directory where grafana will automatically scan and look for plugins
  18. ;plugins = /var/lib/grafana/plugins
  19. # folder that contains provisioning config files that grafana will apply on startup and while running.
  20. ;provisioning = conf/provisioning
  21. #################################### Server ####################################
  22. [server]
  23. # Protocol (http, https, h2, socket)
  24. ;protocol = http
  25. # The ip address to bind to, empty will bind to all interfaces
  26. ;http_addr =
  27. # The http port to use
  28. ;http_port = 3000
  29. # The public facing domain name used to access grafana from a browser
  30. ;domain = localhost
  31. # Redirect to correct domain if host header does not match domain
  32. # Prevents DNS rebinding attacks
  33. ;enforce_domain = false
  34. # The full public facing url you use in browser, used for redirects and emails
  35. # If you use reverse proxy and sub path specify full url (with sub path)
  36. ;root_url = %(protocol)s://%(domain)s:%(http_port)s/
  37. # Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
  38. ;serve_from_sub_path = false
  39. # Log web requests
  40. ;router_logging = false
  41. # the path relative working path
  42. ;static_root_path = public
  43. # enable gzip
  44. ;enable_gzip = false
  45. # https certs & key file
  46. ;cert_file =
  47. ;cert_key =
  48. # Unix socket path
  49. ;socket =
  50. # CDN Url
  51. ;cdn_url =
  52. # Sets the maximum time using a duration format (5s/5m/5ms) before timing out read of an incoming request and closing idle connections.
  53. # `0` means there is no timeout for reading the request.
  54. ;read_timeout = 0
  55. #################################### Database ####################################
  56. [database]
  57. # You can configure the database connection by specifying type, host, name, user and password
  58. # as separate properties or as on string using the url properties.
  59. # Either "mysql", "postgres" or "sqlite3", it's your choice
  60. ;type = sqlite3
  61. ;host = 127.0.0.1:3306
  62. ;name = grafana
  63. ;user = root
  64. # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
  65. ;password =
  66. # Use either URL or the previous fields to configure the database
  67. # Example: mysql://user:secret@host:port/database
  68. ;url =
  69. # For "postgres" only, either "disable", "require" or "verify-full"
  70. ;ssl_mode = disable
  71. # Database drivers may support different transaction isolation levels.
  72. # Currently, only "mysql" driver supports isolation levels.
  73. # If the value is empty - driver's default isolation level is applied.
  74. # For "mysql" use "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ" or "SERIALIZABLE".
  75. ;isolation_level =
  76. ;ca_cert_path =
  77. ;client_key_path =
  78. ;client_cert_path =
  79. ;server_cert_name =
  80. # For "sqlite3" only, path relative to data_path setting
  81. ;path = grafana.db
  82. # Max idle conn setting default is 2
  83. ;max_idle_conn = 2
  84. # Max conn setting default is 0 (mean not set)
  85. ;max_open_conn =
  86. # Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours)
  87. ;conn_max_lifetime = 14400
  88. # Set to true to log the sql calls and execution times.
  89. ;log_queries =
  90. # For "sqlite3" only. cache mode setting used for connecting to the database. (private, shared)
  91. ;cache_mode = private
  92. ################################### Data sources #########################
  93. [datasources]
  94. # Upper limit of data sources that Grafana will return. This limit is a temporary configuration and it will be deprecated when pagination will be introduced on the list data sources API.
  95. ;datasource_limit = 5000
  96. #################################### Cache server #############################
  97. [remote_cache]
  98. # Either "redis", "memcached" or "database" default is "database"
  99. ;type = database
  100. # cache connectionstring options
  101. # database: will use Grafana primary database.
  102. # redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0,ssl=false`. Only addr is required. ssl may be 'true', 'false', or 'insecure'.
  103. # memcache: 127.0.0.1:11211
  104. ;connstr =
  105. #################################### Data proxy ###########################
  106. [dataproxy]
  107. # This enables data proxy logging, default is false
  108. ;logging = false
  109. # How long the data proxy waits to read the headers of the response before timing out, default is 30 seconds.
  110. # This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set.
  111. ;timeout = 30
  112. # How long the data proxy waits to establish a TCP connection before timing out, default is 10 seconds.
  113. ;dialTimeout = 10
  114. # How many seconds the data proxy waits before sending a keepalive probe request.
  115. ;keep_alive_seconds = 30
  116. # How many seconds the data proxy waits for a successful TLS Handshake before timing out.
  117. ;tls_handshake_timeout_seconds = 10
  118. # How many seconds the data proxy will wait for a server's first response headers after
  119. # fully writing the request headers if the request has an "Expect: 100-continue"
  120. # header. A value of 0 will result in the body being sent immediately, without
  121. # waiting for the server to approve.
  122. ;expect_continue_timeout_seconds = 1
  123. # Optionally limits the total number of connections per host, including connections in the dialing,
  124. # active, and idle states. On limit violation, dials will block.
  125. # A value of zero (0) means no limit.
  126. ;max_conns_per_host = 0
  127. # The maximum number of idle connections that Grafana will keep alive.
  128. ;max_idle_connections = 100
  129. # The maximum number of idle connections per host that Grafana will keep alive.
  130. ;max_idle_connections_per_host = 2
  131. # How many seconds the data proxy keeps an idle connection open before timing out.
  132. ;idle_conn_timeout_seconds = 90
  133. # If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
  134. ;send_user_header = false
  135. #################################### Analytics ####################################
  136. [analytics]
  137. # Server reporting, sends usage counters to stats.grafana.org every 24 hours.
  138. # No ip addresses are being tracked, only simple counters to track
  139. # running instances, dashboard and error counts. It is very helpful to us.
  140. # Change this option to false to disable reporting.
  141. ;reporting_enabled = true
  142. # The name of the distributor of the Grafana instance. Ex hosted-grafana, grafana-labs
  143. ;reporting_distributor = grafana-labs
  144. # Set to false to disable all checks to https://grafana.net
  145. # for new versions (grafana itself and plugins), check is used
  146. # in some UI views to notify that grafana or plugin update exists
  147. # This option does not cause any auto updates, nor send any information
  148. # only a GET request to http://grafana.com to get latest versions
  149. ;check_for_updates = true
  150. # Google Analytics universal tracking code, only enabled if you specify an id here
  151. ;google_analytics_ua_id =
  152. # Google Tag Manager ID, only enabled if you specify an id here
  153. ;google_tag_manager_id =
  154. #################################### Security ####################################
  155. [security]
  156. # disable creation of admin user on first start of grafana
  157. ;disable_initial_admin_creation = false
  158. # default admin user, created on startup
  159. ;admin_user = admin
  160. # default admin password, can be changed before first start of grafana, or in profile settings
  161. ;admin_password = admin
  162. # used for signing
  163. ;secret_key = SW2YcwTIb9zpOOhoPsMm
  164. # disable gravatar profile images
  165. ;disable_gravatar = false
  166. # data source proxy whitelist (ip_or_domain:port separated by spaces)
  167. ;data_source_proxy_whitelist =
  168. # disable protection against brute force login attempts
  169. ;disable_brute_force_login_protection = false
  170. # set to true if you host Grafana behind HTTPS. default is false.
  171. ;cookie_secure = false
  172. # set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled"
  173. ;cookie_samesite = lax
  174. # set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
  175. ;allow_embedding = true
  176. # Set to true if you want to enable http strict transport security (HSTS) response header.
  177. # This is only sent when HTTPS is enabled in this configuration.
  178. # HSTS tells browsers that the site should only be accessed using HTTPS.
  179. ;strict_transport_security = false
  180. # Sets how long a browser should cache HSTS. Only applied if strict_transport_security is enabled.
  181. ;strict_transport_security_max_age_seconds = 86400
  182. # Set to true if to enable HSTS preloading option. Only applied if strict_transport_security is enabled.
  183. ;strict_transport_security_preload = false
  184. # Set to true if to enable the HSTS includeSubDomains option. Only applied if strict_transport_security is enabled.
  185. ;strict_transport_security_subdomains = false
  186. # Set to true to enable the X-Content-Type-Options response header.
  187. # The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised
  188. # in the Content-Type headers should not be changed and be followed.
  189. ;x_content_type_options = true
  190. # Set to true to enable the X-XSS-Protection header, which tells browsers to stop pages from loading
  191. # when they detect reflected cross-site scripting (XSS) attacks.
  192. ;x_xss_protection = true
  193. # Enable adding the Content-Security-Policy header to your requests.
  194. # CSP allows to control resources the user agent is allowed to load and helps prevent XSS attacks.
  195. ;content_security_policy = false
  196. # Set Content Security Policy template used when adding the Content-Security-Policy header to your requests.
  197. # $NONCE in the template includes a random nonce.
  198. # $ROOT_PATH is server.root_url without the protocol.
  199. ;content_security_policy_template = """script-src 'self' 'unsafe-eval' 'unsafe-inline' 'strict-dynamic' $NONCE;object-src 'none';font-src 'self';style-src 'self' 'unsafe-inline' blob:;img-src * data:;base-uri 'self';connect-src 'self' grafana.com ws://$ROOT_PATH wss://$ROOT_PATH;manifest-src 'self';media-src 'none';form-action 'self';"""
  200. #################################### Snapshots ###########################
  201. [snapshots]
  202. # snapshot sharing options
  203. ;external_enabled = true
  204. ;external_snapshot_url = https://snapshots-origin.raintank.io
  205. ;external_snapshot_name = Publish to snapshot.raintank.io
  206. # Set to true to enable this Grafana instance act as an external snapshot server and allow unauthenticated requests for
  207. # creating and deleting snapshots.
  208. ;public_mode = false
  209. # remove expired snapshot
  210. ;snapshot_remove_expired = true
  211. #################################### Dashboards History ##################
  212. [dashboards]
  213. # Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1
  214. ;versions_to_keep = 20
  215. # Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is 5 seconds.
  216. # The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
  217. ;min_refresh_interval = 5s
  218. # Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json"
  219. ;default_home_dashboard_path =
  220. #################################### Users ###############################
  221. [users]
  222. # disable user signup / registration
  223. ;allow_sign_up = true
  224. # Allow non admin users to create organizations
  225. ;allow_org_create = true
  226. #default_language = en-US
  227. ;default_language = zh-Hans
  228. # Set to true to automatically assign new users to the default organization (id 1)
  229. ;auto_assign_org = true
  230. # Set this value to automatically add new users to the provided organization (if auto_assign_org above is set to true)
  231. ;auto_assign_org_id = 1
  232. # Default role new users will be automatically assigned (if disabled above is set to true)
  233. ;auto_assign_org_role = Viewer
  234. # Require email validation before sign up completes
  235. ;verify_email_enabled = false
  236. # Background text for the user field on the login page
  237. ;login_hint = email or username
  238. ;password_hint = password
  239. # Default UI theme ("dark" or "light")
  240. ;default_theme = dark
  241. # Path to a custom home page. Users are only redirected to this if the default home dashboard is used. It should match a frontend route and contain a leading slash.
  242. ; home_page =
  243. # External user management, these options affect the organization users view
  244. ;external_manage_link_url =
  245. ;external_manage_link_name =
  246. ;external_manage_info =
  247. # Viewers can edit/inspect dashboard settings in the browser. But not save the dashboard.
  248. ;viewers_can_edit = false
  249. # Editors can administrate dashboard, folders and teams they create
  250. ;editors_can_admin = false
  251. # The duration in time a user invitation remains valid before expiring. This setting should be expressed as a duration. Examples: 6h (hours), 2d (days), 1w (week). Default is 24h (24 hours). The minimum supported duration is 15m (15 minutes).
  252. ;user_invite_max_lifetime_duration = 24h
  253. # Enter a comma-separated list of users login to hide them in the Grafana UI. These users are shown to Grafana admins and themselves.
  254. ; hidden_users =
  255. [auth]
  256. # Login cookie name
  257. ;login_cookie_name = grafana_session
  258. # The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). The lifetime resets at each successful token rotation.
  259. ;login_maximum_inactive_lifetime_duration =
  260. # The maximum lifetime (duration) an authenticated user can be logged in since login time before being required to login. Default is 30 days (30d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month).
  261. ;login_maximum_lifetime_duration =
  262. # How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
  263. ;token_rotation_interval_minutes = 10
  264. # Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
  265. ;disable_login_form = false
  266. # Set to true to disable the sign out link in the side menu. Useful if you use auth.proxy or auth.jwt, defaults to false
  267. ;disable_signout_menu = false
  268. # URL to redirect the user to after sign out
  269. ;signout_redirect_url =
  270. # Set to true to attempt login with OAuth automatically, skipping the login screen.
  271. # This setting is ignored if multiple OAuth providers are configured.
  272. ;oauth_auto_login = false
  273. # OAuth state max age cookie duration in seconds. Defaults to 600 seconds.
  274. ;oauth_state_cookie_max_age = 600
  275. # limit of api_key seconds to live before expiration
  276. ;api_key_max_seconds_to_live = -1
  277. # Set to true to enable SigV4 authentication option for HTTP-based datasources.
  278. ;sigv4_auth_enabled = false
  279. #################################### Anonymous Auth ######################
  280. [auth.anonymous]
  281. # enable anonymous access
  282. ;enabled = true
  283. # specify organization name that should be used for unauthenticated users
  284. ;org_name = Main Org.
  285. # specify role for unauthenticated users
  286. ;org_role = Viewer
  287. # mask the Grafana version number for unauthenticated users
  288. ;hide_version = false
  289. #################################### GitHub Auth ##########################
  290. [auth.github]
  291. ;enabled = false
  292. ;allow_sign_up = true
  293. ;client_id = some_id
  294. ;client_secret = some_secret
  295. ;scopes = user:email,read:org
  296. ;auth_url = https://github.com/login/oauth/authorize
  297. ;token_url = https://github.com/login/oauth/access_token
  298. ;api_url = https://api.github.com/user
  299. ;allowed_domains =
  300. ;team_ids =
  301. ;allowed_organizations =
  302. #################################### GitLab Auth #########################
  303. [auth.gitlab]
  304. ;enabled = false
  305. ;allow_sign_up = true
  306. ;client_id = some_id
  307. ;client_secret = some_secret
  308. ;scopes = api
  309. ;auth_url = https://gitlab.com/oauth/authorize
  310. ;token_url = https://gitlab.com/oauth/token
  311. ;api_url = https://gitlab.com/api/v4
  312. ;allowed_domains =
  313. ;allowed_groups =
  314. #################################### Google Auth ##########################
  315. [auth.google]
  316. ;enabled = false
  317. ;allow_sign_up = true
  318. ;client_id = some_client_id
  319. ;client_secret = some_client_secret
  320. ;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
  321. ;auth_url = https://accounts.google.com/o/oauth2/auth
  322. ;token_url = https://accounts.google.com/o/oauth2/token
  323. ;api_url = https://www.googleapis.com/oauth2/v1/userinfo
  324. ;allowed_domains =
  325. ;hosted_domain =
  326. #################################### Grafana.com Auth ####################
  327. [auth.grafana_com]
  328. ;enabled = false
  329. ;allow_sign_up = true
  330. ;client_id = some_id
  331. ;client_secret = some_secret
  332. ;scopes = user:email
  333. ;allowed_organizations =
  334. #################################### Azure AD OAuth #######################
  335. [auth.azuread]
  336. ;name = Azure AD
  337. ;enabled = false
  338. ;allow_sign_up = true
  339. ;client_id = some_client_id
  340. ;client_secret = some_client_secret
  341. ;scopes = openid email profile
  342. ;auth_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize
  343. ;token_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
  344. ;allowed_domains =
  345. ;allowed_groups =
  346. #################################### Okta OAuth #######################
  347. [auth.okta]
  348. ;name = Okta
  349. ;enabled = false
  350. ;allow_sign_up = true
  351. ;client_id = some_id
  352. ;client_secret = some_secret
  353. ;scopes = openid profile email groups
  354. ;auth_url = https://<tenant-id>.okta.com/oauth2/v1/authorize
  355. ;token_url = https://<tenant-id>.okta.com/oauth2/v1/token
  356. ;api_url = https://<tenant-id>.okta.com/oauth2/v1/userinfo
  357. ;allowed_domains =
  358. ;allowed_groups =
  359. ;role_attribute_path =
  360. ;role_attribute_strict = false
  361. #################################### Generic OAuth ##########################
  362. [auth.generic_oauth]
  363. ;enabled = false
  364. ;name = OAuth
  365. ;allow_sign_up = true
  366. ;client_id = some_id
  367. ;client_secret = some_secret
  368. ;scopes = user:email,read:org
  369. ;empty_scopes = false
  370. ;email_attribute_name = email:primary
  371. ;email_attribute_path =
  372. ;login_attribute_path =
  373. ;name_attribute_path =
  374. ;id_token_attribute_name =
  375. ;auth_url = https://foo.bar/login/oauth/authorize
  376. ;token_url = https://foo.bar/login/oauth/access_token
  377. ;api_url = https://foo.bar/user
  378. ;allowed_domains =
  379. ;team_ids =
  380. ;allowed_organizations =
  381. ;role_attribute_path =
  382. ;role_attribute_strict = false
  383. ;tls_skip_verify_insecure = false
  384. ;tls_client_cert =
  385. ;tls_client_key =
  386. ;tls_client_ca =
  387. #################################### Basic Auth ##########################
  388. [auth.basic]
  389. ;enabled = true
  390. #################################### Auth Proxy ##########################
  391. [auth.proxy]
  392. ;enabled = false
  393. ;header_name = X-WEBAUTH-USER
  394. ;header_property = username
  395. ;auto_sign_up = true
  396. ;sync_ttl = 60
  397. ;whitelist = 192.168.1.1, 192.168.2.1
  398. ;headers = Email:X-User-Email, Name:X-User-Name
  399. # Read the auth proxy docs for details on what the setting below enables
  400. ;enable_login_token = false
  401. #################################### Auth JWT ##########################
  402. [auth.jwt]
  403. ;enabled = true
  404. ;header_name = X-JWT-Assertion
  405. ;email_claim = sub
  406. ;username_claim = sub
  407. ;jwk_set_url = https://foo.bar/.well-known/jwks.json
  408. ;jwk_set_file = /path/to/jwks.json
  409. ;cache_ttl = 60m
  410. ;expected_claims = {"aud": ["foo", "bar"]}
  411. ;key_file = /path/to/key/file
  412. #################################### Auth LDAP ##########################
  413. [auth.ldap]
  414. ;enabled = false
  415. ;config_file = /etc/grafana/ldap.toml
  416. ;allow_sign_up = true
  417. # LDAP background sync (Enterprise only)
  418. # At 1 am every day
  419. ;sync_cron = "0 0 1 * * *"
  420. ;active_sync_enabled = true
  421. #################################### AWS ###########################
  422. [aws]
  423. # Enter a comma-separated list of allowed AWS authentication providers.
  424. # Options are: default (AWS SDK Default), keys (Access && secret key), credentials (Credentials field), ec2_iam_role (EC2 IAM Role)
  425. ; allowed_auth_providers = default,keys,credentials
  426. # Allow AWS users to assume a role using temporary security credentials.
  427. # If true, assume role will be enabled for all AWS authentication providers that are specified in aws_auth_providers
  428. ; assume_role_enabled = true
  429. #################################### Azure ###############################
  430. [azure]
  431. # Azure cloud environment where Grafana is hosted
  432. # Possible values are AzureCloud, AzureChinaCloud, AzureUSGovernment and AzureGermanCloud
  433. # Default value is AzureCloud (i.e. public cloud)
  434. ;cloud = AzureCloud
  435. # Specifies whether Grafana hosted in Azure service with Managed Identity configured (e.g. Azure Virtual Machines instance)
  436. # If enabled, the managed identity can be used for authentication of Grafana in Azure services
  437. # Disabled by default, needs to be explicitly enabled
  438. ;managed_identity_enabled = false
  439. # Client ID to use for user-assigned managed identity
  440. # Should be set for user-assigned identity and should be empty for system-assigned identity
  441. ;managed_identity_client_id =
  442. #################################### SMTP / Emailing ##########################
  443. [smtp]
  444. ;enabled = false
  445. ;host = localhost:25
  446. ;user =
  447. # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
  448. ;password =
  449. ;cert_file =
  450. ;key_file =
  451. ;skip_verify = false
  452. ;from_address = admin@grafana.localhost
  453. ;from_name = Grafana
  454. # EHLO identity in SMTP dialog (defaults to instance_name)
  455. ;ehlo_identity = dashboard.example.com
  456. # SMTP startTLS policy (defaults to 'OpportunisticStartTLS')
  457. ;startTLS_policy = NoStartTLS
  458. [emails]
  459. ;welcome_email_on_sign_up = false
  460. ;templates_pattern = emails/*.html
  461. #################################### Logging ##########################
  462. [log]
  463. # Either "console", "file", "syslog". Default is console and file
  464. # Use space to separate multiple modes, e.g. "console file"
  465. ;mode = console file
  466. # Either "debug", "info", "warn", "error", "critical", default is "info"
  467. ;level = info
  468. # optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
  469. ;filters =
  470. # For "console" mode only
  471. [log.console]
  472. ;level =
  473. # log line format, valid options are text, console and json
  474. ;format = console
  475. # For "file" mode only
  476. [log.file]
  477. ;level =
  478. # log line format, valid options are text, console and json
  479. ;format = text
  480. # This enables automated log rotate(switch of following options), default is true
  481. ;log_rotate = true
  482. # Max line number of single file, default is 1000000
  483. ;max_lines = 1000000
  484. # Max size shift of single file, default is 28 means 1 << 28, 256MB
  485. ;max_size_shift = 28
  486. # Segment log daily, default is true
  487. ;daily_rotate = true
  488. # Expired days of log file(delete after max days), default is 7
  489. ;max_days = 7
  490. [log.syslog]
  491. ;level =
  492. # log line format, valid options are text, console and json
  493. ;format = text
  494. # Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
  495. ;network =
  496. ;address =
  497. # Syslog facility. user, daemon and local0 through local7 are valid.
  498. ;facility =
  499. # Syslog tag. By default, the process' argv[0] is used.
  500. ;tag =
  501. [log.frontend]
  502. # Should Sentry javascript agent be initialized
  503. ;enabled = false
  504. # Sentry DSN if you want to send events to Sentry.
  505. ;sentry_dsn =
  506. # Custom HTTP endpoint to send events captured by the Sentry agent to. Default will log the events to stdout.
  507. ;custom_endpoint = /log
  508. # Rate of events to be reported between 0 (none) and 1 (all), float
  509. ;sample_rate = 1.0
  510. # Requests per second limit enforced an extended period, for Grafana backend log ingestion endpoint (/log).
  511. ;log_endpoint_requests_per_second_limit = 3
  512. # Max requests accepted per short interval of time for Grafana backend log ingestion endpoint (/log).
  513. ;log_endpoint_burst_limit = 15
  514. #################################### Usage Quotas ########################
  515. [quota]
  516. ; enabled = false
  517. #### set quotas to -1 to make unlimited. ####
  518. # limit number of users per Org.
  519. ; org_user = 10
  520. # limit number of dashboards per Org.
  521. ; org_dashboard = 100
  522. # limit number of data_sources per Org.
  523. ; org_data_source = 10
  524. # limit number of api_keys per Org.
  525. ; org_api_key = 10
  526. # limit number of alerts per Org.
  527. ;org_alert_rule = 100
  528. # limit number of orgs a user can create.
  529. ; user_org = 10
  530. # Global limit of users.
  531. ; global_user = -1
  532. # global limit of orgs.
  533. ; global_org = -1
  534. # global limit of dashboards
  535. ; global_dashboard = -1
  536. # global limit of api_keys
  537. ; global_api_key = -1
  538. # global limit on number of logged in users.
  539. ; global_session = -1
  540. # global limit of alerts
  541. ;global_alert_rule = -1
  542. #################################### Alerting ############################
  543. [alerting]
  544. # Disable alerting engine & UI features
  545. ;enabled = true
  546. # Makes it possible to turn off alert rule execution but alerting UI is visible
  547. ;execute_alerts = true
  548. # Default setting for new alert rules. Defaults to categorize error and timeouts as alerting. (alerting, keep_state)
  549. ;error_or_timeout = alerting
  550. # Default setting for how Grafana handles nodata or null values in alerting. (alerting, no_data, keep_state, ok)
  551. ;nodata_or_nullvalues = no_data
  552. # Alert notifications can include images, but rendering many images at the same time can overload the server
  553. # This limit will protect the server from render overloading and make sure notifications are sent out quickly
  554. ;concurrent_render_limit = 5
  555. # Default setting for alert calculation timeout. Default value is 30
  556. ;evaluation_timeout_seconds = 30
  557. # Default setting for alert notification timeout. Default value is 30
  558. ;notification_timeout_seconds = 30
  559. # Default setting for max attempts to sending alert notifications. Default value is 3
  560. ;max_attempts = 3
  561. # Makes it possible to enforce a minimal interval between evaluations, to reduce load on the backend
  562. ;min_interval_seconds = 1
  563. # Configures for how long alert annotations are stored. Default is 0, which keeps them forever.
  564. # This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month).
  565. ;max_annotation_age =
  566. # Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations.
  567. ;max_annotations_to_keep =
  568. #################################### Annotations #########################
  569. [annotations]
  570. # Configures the batch size for the annotation clean-up job. This setting is used for dashboard, API, and alert annotations.
  571. ;cleanupjob_batchsize = 100
  572. [annotations.dashboard]
  573. # Dashboard annotations means that annotations are associated with the dashboard they are created on.
  574. # Configures how long dashboard annotations are stored. Default is 0, which keeps them forever.
  575. # This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month).
  576. ;max_age =
  577. # Configures max number of dashboard annotations that Grafana stores. Default value is 0, which keeps all dashboard annotations.
  578. ;max_annotations_to_keep =
  579. [annotations.api]
  580. # API annotations means that the annotations have been created using the API without any
  581. # association with a dashboard.
  582. # Configures how long Grafana stores API annotations. Default is 0, which keeps them forever.
  583. # This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month).
  584. ;max_age =
  585. # Configures max number of API annotations that Grafana keeps. Default value is 0, which keeps all API annotations.
  586. ;max_annotations_to_keep =
  587. #################################### Explore #############################
  588. [explore]
  589. # Enable the Explore section
  590. ;enabled = true
  591. #################################### Internal Grafana Metrics ##########################
  592. # Metrics available at HTTP API Url /metrics
  593. [metrics]
  594. # Disable / Enable internal metrics
  595. ;enabled = true
  596. # Graphite Publish interval
  597. ;interval_seconds = 10
  598. # Disable total stats (stat_totals_*) metrics to be generated
  599. ;disable_total_stats = false
  600. #If both are set, basic auth will be required for the metrics endpoint.
  601. ; basic_auth_username =
  602. ; basic_auth_password =
  603. # Metrics environment info adds dimensions to the `grafana_environment_info` metric, which
  604. # can expose more information about the Grafana instance.
  605. [metrics.environment_info]
  606. #exampleLabel1 = exampleValue1
  607. #exampleLabel2 = exampleValue2
  608. # Send internal metrics to Graphite
  609. [metrics.graphite]
  610. # Enable by setting the address setting (ex localhost:2003)
  611. ;address =
  612. ;prefix = prod.grafana.%(instance_name)s.
  613. #################################### Grafana.com integration ##########################
  614. # Url used to import dashboards directly from Grafana.com
  615. [grafana_com]
  616. ;url = https://grafana.com
  617. #################################### Distributed tracing ############
  618. [tracing.jaeger]
  619. # Enable by setting the address sending traces to jaeger (ex localhost:6831)
  620. ;address = localhost:6831
  621. # Tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
  622. ;always_included_tag = tag1:value1
  623. # Type specifies the type of the sampler: const, probabilistic, rateLimiting, or remote
  624. ;sampler_type = const
  625. # jaeger samplerconfig param
  626. # for "const" sampler, 0 or 1 for always false/true respectively
  627. # for "probabilistic" sampler, a probability between 0 and 1
  628. # for "rateLimiting" sampler, the number of spans per second
  629. # for "remote" sampler, param is the same as for "probabilistic"
  630. # and indicates the initial sampling rate before the actual one
  631. # is received from the mothership
  632. ;sampler_param = 1
  633. # sampling_server_url is the URL of a sampling manager providing a sampling strategy.
  634. ;sampling_server_url =
  635. # Whether or not to use Zipkin propagation (x-b3- HTTP headers).
  636. ;zipkin_propagation = false
  637. # Setting this to true disables shared RPC spans.
  638. # Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
  639. ;disable_shared_zipkin_spans = false
  640. #################################### External image storage ##########################
  641. [external_image_storage]
  642. # Used for uploading images to public servers so they can be included in slack/email messages.
  643. # you can choose between (s3, webdav, gcs, azure_blob, local)
  644. ;provider =
  645. [external_image_storage.s3]
  646. ;endpoint =
  647. ;path_style_access =
  648. ;bucket =
  649. ;region =
  650. ;path =
  651. ;access_key =
  652. ;secret_key =
  653. [external_image_storage.webdav]
  654. ;url =
  655. ;public_url =
  656. ;username =
  657. ;password =
  658. [external_image_storage.gcs]
  659. ;key_file =
  660. ;bucket =
  661. ;path =
  662. [external_image_storage.azure_blob]
  663. ;account_name =
  664. ;account_key =
  665. ;container_name =
  666. [external_image_storage.local]
  667. # does not require any configuration
  668. [rendering]
  669. # Options to configure a remote HTTP image rendering service, e.g. using https://github.com/grafana/grafana-image-renderer.
  670. # 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.
  671. ;server_url =
  672. # 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/.
  673. ;callback_url =
  674. # Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
  675. # which this setting can help protect against by only allowing a certain amount of concurrent requests.
  676. ;concurrent_render_request_limit = 30
  677. [panels]
  678. # If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
  679. ;disable_sanitize_html = false
  680. [plugins]
  681. ;enable_alpha = false
  682. ;app_tls_skip_verify_insecure = false
  683. # Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
  684. ;allow_loading_unsigned_plugins =
  685. # Enable or disable installing plugins directly from within Grafana.
  686. ;plugin_admin_enabled = false
  687. ;plugin_admin_external_manage_enabled = false
  688. ;plugin_catalog_url = https://grafana.com/grafana/plugins/
  689. #################################### Grafana Live ##########################################
  690. [live]
  691. # max_connections to Grafana Live WebSocket endpoint per Grafana server instance. See Grafana Live docs
  692. # if you are planning to make it higher than default 100 since this can require some OS and infrastructure
  693. # tuning. 0 disables Live, -1 means unlimited connections.
  694. ;max_connections = 100
  695. # allowed_origins is a comma-separated list of origins that can establish connection with Grafana Live.
  696. # If not set then origin will be matched over root_url. Supports wildcard symbol "*".
  697. ;allowed_origins =
  698. #################################### Grafana Image Renderer Plugin ##########################
  699. [plugin.grafana-image-renderer]
  700. # Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
  701. # See ICU’s metaZones.txt (https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt) for a list of supported
  702. # timezone IDs. Fallbacks to TZ environment variable if not set.
  703. ;rendering_timezone =
  704. # Instruct headless browser instance to use a default language when not provided by Grafana, e.g. when rendering panel image of alert.
  705. # 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'.
  706. ;rendering_language =
  707. # Instruct headless browser instance to use a default device scale factor when not provided by Grafana, e.g. when rendering panel image of alert.
  708. # Default is 1. Using a higher value will produce more detailed images (higher DPI), but will require more disk space to store an image.
  709. ;rendering_viewport_device_scale_factor =
  710. # Instruct headless browser instance whether to ignore HTTPS errors during navigation. Per default HTTPS errors are not ignored. Due to
  711. # the security risk it's not recommended to ignore HTTPS errors.
  712. ;rendering_ignore_https_errors =
  713. # Instruct headless browser instance whether to capture and log verbose information when rendering an image. Default is false and will
  714. # only capture and log error messages. When enabled, debug messages are captured and logged as well.
  715. # For the verbose information to be included in the Grafana server log you have to adjust the rendering log level to debug, configure
  716. # [log].filter = rendering:debug.
  717. ;rendering_verbose_logging =
  718. # Instruct headless browser instance whether to output its debug and error messages into running process of remote rendering service.
  719. # Default is false. This can be useful to enable (true) when troubleshooting.
  720. ;rendering_dumpio =
  721. # Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found
  722. # here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character.
  723. ;rendering_args =
  724. # You can configure the plugin to use a different browser binary instead of the pre-packaged version of Chromium.
  725. # Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
  726. # compatible with the plugin.
  727. ;rendering_chrome_bin =
  728. # Instruct how headless browser instances are created. Default is 'default' and will create a new browser instance on each request.
  729. # Mode 'clustered' will make sure that only a maximum of browsers/incognito pages can execute concurrently.
  730. # Mode 'reusable' will have one browser instance and will create a new incognito page on each request.
  731. ;rendering_mode =
  732. # When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
  733. # and will cluster using browser instances.
  734. # Mode 'context' will cluster using incognito pages.
  735. ;rendering_clustering_mode =
  736. # When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
  737. ;rendering_clustering_max_concurrency =
  738. # Limit the maximum viewport width, height and device scale factor that can be requested.
  739. ;rendering_viewport_max_width =
  740. ;rendering_viewport_max_height =
  741. ;rendering_viewport_max_device_scale_factor =
  742. # 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
  743. # a port not in use.
  744. ;grpc_host =
  745. ;grpc_port =
  746. [enterprise]
  747. # Path to a valid Grafana Enterprise license.jwt file
  748. ;license_path =
  749. [feature_toggles]
  750. # enable features, separated by spaces
  751. ;enable =
  752. [date_formats]
  753. # For information on what formatting patterns that are supported https://momentjs.com/docs/#/displaying/
  754. # Default system date format used in time range picker and other places where full time is displayed
  755. ;full_date = YYYY-MM-DD HH:mm:ss
  756. # Used by graph and other places where we only show small intervals
  757. ;interval_second = HH:mm:ss
  758. ;interval_minute = HH:mm
  759. ;interval_hour = MM/DD HH:mm
  760. ;interval_day = MM/DD
  761. ;interval_month = YYYY-MM
  762. ;interval_year = YYYY
  763. # Experimental feature
  764. ;use_browser_locale = false
  765. # Default timezone for user preferences. Options are 'browser' for the browser local timezone or a timezone name from IANA Time Zone database, e.g. 'UTC' or 'Europe/Amsterdam' etc.
  766. ;default_timezone = browser
  767. [expressions]
  768. # Enable or disable the expressions functionality.
  769. ;enabled = true

 4.重启项目

service grafana-server restart

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/566501
推荐阅读
相关标签
  

闽ICP备14008679号