Skip to content

feat: Add Configurable GeneratorURL Templates for Alerts - #737

Closed
ramessesii2 wants to merge 7 commits into
jacksontj:masterfrom
ramessesii2:RAMESSES/generateURL-configurable-templating
Closed

feat: Add Configurable GeneratorURL Templates for Alerts#737
ramessesii2 wants to merge 7 commits into
jacksontj:masterfrom
ramessesii2:RAMESSES/generateURL-configurable-templating

Conversation

@ramessesii2

Copy link
Copy Markdown
Contributor

Fixes #736

This PR implements configurable GeneratorURL templates for alerts in Promxy. This enables integration with third-party alert UIs, incident management systems, and custom dashboards by allowing administrators to configure how alert URLs are generated based on alert context.

✅ Tests
✅ Docs
✅ Example yamls

Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
    - simplify alerting logic

Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
@ramessesii2

Copy link
Copy Markdown
Contributor Author

@jacksontj PTAL in your time. I'm happy to address any reviews. Thanks!

jacksontj added a commit that referenced this pull request Jul 3, 2026
Promxy hardcodes the alert GeneratorURL to a link to its own graph page for
the alert expression, matching upstream Prometheus. When promxy is the central
evaluation point for many backends and operators triage alerts elsewhere
(Grafana alerting, an incident manager, a per-tenant dashboard), that URL is
not useful -- and points at the wrong backend for series that originated in
e.g. VictoriaMetrics.

Add an opt-in pkg/alerttemplate that renders the GeneratorURL from Go
templates configured under promxy.alert_templates: a default template, reusable
named templates, and label-matched rules (first match wins). Templates are
compiled once on config (re)load behind a RWMutex and selected per-alert in
sendAlerts; with no configuration promxy falls back to the exact built-in URL,
so default behavior is unchanged.

Reimplementation of the approach in #737, rebased onto the post-Prometheus-3.5
master and scoped down (no template directory / .tmpl loader, no CLI flags --
inline named templates cover the use cases in #736).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jacksontj added a commit that referenced this pull request Jul 3, 2026
Promxy hardcodes the alert GeneratorURL to a link to its own graph page for
the alert expression, matching upstream Prometheus. When promxy is the central
evaluation point for many backends and operators triage alerts elsewhere
(Grafana alerting, an incident manager, a per-tenant dashboard), that URL is
not useful -- and points at the wrong backend for series that originated in
e.g. VictoriaMetrics.

Add an opt-in pkg/alerttemplate that renders the GeneratorURL from Go
templates configured under promxy.alert_templates: a default template, reusable
named templates, and label-matched rules (first match wins). Templates are
compiled once on config (re)load behind a RWMutex and selected per-alert in
sendAlerts; with no configuration promxy falls back to the exact built-in URL,
so default behavior is unchanged.

Reimplementation of the approach in #737, rebased onto the post-Prometheus-3.5
master and scoped down (no template directory / .tmpl loader, no CLI flags --
inline named templates cover the use cases in #736).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ramessesii2

Copy link
Copy Markdown
Contributor Author

closing in favor of #798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable Alert GeneratorURL Templates

1 participant