Grafana基础配置文件

发布时间:2020-04-02 20:35:13 作者:DBAspace
来源:网络 阅读:1397

官方是怎么解释Grafana的:

    grafana是用于可视化大型测量数据的开源程序,他提供了强大和优雅的方式去创建、共享、浏览数据。dashboard中显示了你不同metric数据源中的数据。

    grafana最常用于因特网基础设施和应用分析,但在其他领域也有机会用到,比如:工业传感器、家庭自动化、过程控制等等。

    grafana有热插拔控制面板和可扩展的数据源,目前已经支持Graphite、InfluxDB、OpenTSDB、Elasticsearch。

    


app_mode:应用名称,默认是production


[database]

# Either "mysql", "postgres" or "sqlite3", it's your choice

;type = sqlite3

;host = 127.0.0.1:3306

;name = grafana

;user = root

;password =


# For "postgres" only, either "disable", "require" or "verify-full"

;ssl_mode = disable


# For "sqlite3" only, path relative to data_path setting

;path = grafana.db

默认使用sqlite3,可以根据实际修改存储数据源

[server]

http_addr:监听的ip地址,,默认是0.0.0.0

http_port:监听的端口,默认是3000

protocol:http或者https,,默认是http

domain:这个设置是root_url的一部分,当你通过浏览器访问grafana时的公开的domian名称,默认是localhost

enforce_domain:如果主机的header不匹配domian,则跳转到一个正确的domain上,默认是false

root_url:这是一个web上访问grafana的全路径url,默认是%(protocol)s://%(domain)s:%(http_port)s/

router_logging:是否记录web请求日志,默认是false

cert_file:如果使用https则需要设置

cert_key:如果使用https则需要设置


[database]

grafana默认需要使用数据库存储用户和dashboard信息,默认使用sqlite3来存储,你也可以换成其他数据库

type:可以是mysql、postgres、sqlite3,默认是sqlite3

path:只是sqlite3需要,定义sqlite3的存储路径

host:只是mysql、postgres需要,默认是127.0.0.1:3306

name:grafana的数据库名称,默认是grafana

user:连接数据库的用户

password:数据库用户的密码

ssl_mode:只是postgres使用



[security]

admin_user:grafana默认的admin用户,默认是admin

admin_password:grafana admin的默认密码,默认是admin

login_remember_days:多少天内保持登录状态

secret_key:保持登录状态的签名

disable_gravatar:



[users]

allow_sign_up:是否允许普通用户登录,如果设置为false,则禁止用户登录,默认是true,则admin可以创建用户,并登录grafana

allow_org_create:如果设置为false,则禁止用户创建新组织,默认是true

auto_assign_org:当设置为true的时候,会自动的把新增用户增加到id为1的组织中,当设置为false的时候,新建用户的时候会新增一个组织

auto_assign_org_role:新建用户附加的规则,默认是Viewer,还可以是Admin、Editor



[auth.anonymous]

enabled:设置为true,则开启允许匿名访问,默认是false

org_name:为匿名用户设置组织名称

org_role:为匿名用户设置的访问规则,默认是Viewer



[auth.github]

针对github项目的,很明显,呵呵

enabled = false

allow_sign_up = false

client_id = some_id

client_secret = some_secret

scopes = user:email

auth_url = https://github.com/login/oauth/authorize

token_url = https://github.com/login/oauth/access_token

api_url = https://api.github.com/user

team_ids =

allowed_domains =

allowed_organizations =



[auth.google]

针对google app的

enabled = false

allow_sign_up = false

client_id = some_client_id

client_secret = some_client_secret

scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email

auth_url = https://accounts.google.com/o/oauth3/auth

token_url = https://accounts.google.com/o/oauth3/token

api_url = https://www.googleapis.com/oauth3/v1/userinfo

allowed_domains =



[auth.basic]

enabled:当设置为true,则http api开启基本认证



[auth.ldap]

enabled:设置为true则开启LDAP认证,默认是false

config_file:如果开启LDAP,指定LDAP的配置文件/etc/grafana/ldap.toml



[auth.proxy]

允许你在一个HTTP反向代理上进行认证设置

enabled:默认是false

header_name:默认是X-WEBAUTH-USER

header_property:默认是个名称username

auto_sign_up:默认是true。开启自动注册,如果用户在grafana DB中不存在


[analytics]

reporting_enabled:如果设置为true,则会发送匿名使用分析到stats.grafana.org,主要用于跟踪允许实例、版本、dashboard、错误统计。默认是true

google_analytics_ua_id:使用GA进行分析,填写你的GA ID即可



[dashboards.json]

如果你有一个系统自动产生json格式的dashboard,则可以开启这个特性试试

enabled:默认是false

path:一个全路径用来包含你的json dashboard,默认是/var/lib/grafana/dashboards



[session]

provider:默认是file,值还可以是memory、mysql、postgres

provider_config:这个值的配置由provider的设置来确定,如果provider是file,则是data/xxxx路径类型,如果provider是mysql,则是user:password@tcp(127.0.0.1:3306)/database_name,如果provider是postgres,则是user=a password=b host=localhost port=5432 dbname=c sslmode=disable

cookie_name:grafana的cookie名称

cookie_secure:如果设置为true,则grafana依赖https,默认是false

session_life_time:session过期时间,默认是86400秒,24小时



在4.0版本alert功能使用

[smtp]

enabled = true

host = smtp.126.com:25

user =gamebarlepus1

password =126的客户端授权码

;cert_file =

;key_file =

;skip_verify = false

from_address = gamebarlepus1@126.com


[emails]

welcome_email_on_sign_up = false

templates_pattern = emails/*.html



[log]

mode:可以是console、file,默认是console、file,也可以设置多个,用逗号隔开

buffer_len:channel的buffer长度,默认是10000

level:可以是"Trace", "Debug", "Info", "Warn", "Error", "Critical",默认是info


[log.console]

level:设置级别


[log.file]

level:设置级别

log_rotate:是否开启自动轮转

max_lines:单个日志文件的最大行数,默认是1000000

max_lines_shift:单个日志文件的最大大小,默认是28,表示256MB

daily_rotate:每天是否进行日志轮转,默认是true

max_days:日志过期时间,默认是7,7天后删除


推荐阅读:
  1. 配置Grafana用于prometheus
  2. Grafana邮件配置

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

grafana gr

上一篇:如何确定一个网站是用Wordpress开发的

下一篇:安装Oracle的时候报SWAP空间不足的处理方法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》