pgsty / pgsty/pigsty

grafana.ini.j2 sets root_url to a relative path, breaking Discord (and other) webhook notifications

Open
#736 0 comments 0 reactions 1 assignee View on GitHub

@Vonng is already working on this.

Since Apr 7, 2026.

ENHANCEMENT
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

  1. Expose a pigsty.yml variable (e.g. grafana_root_url) that gets templated into grafana.ini.j2, defaulting to http://{{ admin_ip }}/ui/ or deriving from the infra_portal.grafana.domain definition.
  2. Update the template to build root_url from existing variables like infra_portal.grafana.domain and infra_portal.grafana.endpoint.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.