当root#uURL设置为';%时,Grafana电子邮件没有正确的url%(协议)s://%(域)s:%(http_端口)s/grafana';

当root#uURL设置为';%时,Grafana电子邮件没有正确的url%(协议)s://%(域)s:%(http_端口)s/grafana';,grafana,Grafana,我正在为电子邮件邀请设置Grafana Smtp。 我正在使用grafana头盔图表,我的配置如下所示- grafana.ini: smtp: enabled: true host: smtp.sendemail.com:587 user: 'someuser' password: 'somepassword' from_address: join-grafana@somewhere.com from_name: Join Us At Graf

我正在为电子邮件邀请设置Grafana Smtp。 我正在使用grafana头盔图表,我的配置如下所示-

grafana.ini:
  smtp:
    enabled: true
    host: smtp.sendemail.com:587
    user: 'someuser'
    password: 'somepassword'
    from_address: join-grafana@somewhere.com
    from_name: Join Us At Grafana
  server:
    root_url: '%(protocol)s://%(domain)s:%(http_port)s/grafana'
    serve_from_sub_path: true
当我发送电子邮件邀请时,电子邮件会链接到。。。不是我设置的域名;无论出于何种目的,我都可以通过域名使用grafana url,比如-


可能有什么问题?

您需要实际定义所有变量,否则它们将使用默认值,即您在电子邮件中看到的值;如果您像我一样通过代理服务器运行,则可能需要更改URL模板:

[server]
# Protocol (http, https, h2, socket)
protocol = http

# The http port  to use
http_port = 3030

# The public facing domain name used to access grafana from a browser
domain = metrics.example.com

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
root_url = 'https://%(domain)s/grafana/'

我已经通过nginx入口控制器公开了grafana,这就是为什么grafana.ini具有默认值的原因,除了根目录url的子路径和标志SERVICE from_sub_path设置为true之外。除了这个smtp部分,我的grafana工作得很好;我认为,Grafana没有看到电子邮件的入口部分,TBH不需要看到-有没有办法修改/自定义发送的电子邮件内容?电子邮件是根据服务器配置动态生成的,如果您阅读
根url
行上方的注释,它会明确说明这是用于电子邮件的内容。在当前版本(v6.5.3)上运行良好,请尝试完全使用变量:
root\u url=https://metrics.example.com/grafana/“
我找到了电子邮件内容模板所在的位置,但无法自定义;我假设,会有人拥有我使用ingress/nginx公开grafana的用例,并希望有一个选项来定制电子邮件内容。