grafana.ini.j2 sets root_url to a relative path, breaking Discord (and other) webhook notifications
@Vonng is already working on this.
Since Apr 7, 2026.
- Dominant language
- Shell
- Stars
- 5.7k
- Forks
- 384
- Avg merge
- 2h 36m
- Merged PRs (30d)
- 2
Description
The grafana.ini.j2 template sets root_url to a relative path (/ui/). This causes Grafana to generate relative URLs in alert notification payloads; for example, embed URLs like "/ui/alerting/list" instead of fully qualified URLs.
Discord's webhook API rejects payloads containing invalid URLs in embed fields, returning:
webhook failed validation: the Discord API responded (status 400) with error code 0
Expected Behavior
root_url should be a full URL (e.g. https://g.pigsty/ui/) so that Grafana generates valid absolute URLs in all outgoing notifications.
Workaround
Manually edit /etc/grafana/grafana.ini after deployment:
[server]
root_url = https://your-grafana-domain/ui/
Then restart Grafana. Note this gets overwritten on the next ./infra.yml -t grafana run.
As a permanent fix, I guess we could allow one to configure this through the pigsty.yml file
- Expose a
pigsty.ymlvariable (e.g.grafana_root_url) that gets templated intografana.ini.j2, defaulting tohttp://{{ admin_ip }}/ui/or deriving from theinfra_portal.grafana.domaindefinition. - Update the template to build
root_urlfrom existing variables likeinfra_portal.grafana.domainandinfra_portal.grafana.endpoint.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.