feat: Add Configurable GeneratorURL Templates for Alerts - #737
Closed
ramessesii2 wants to merge 7 commits into
Closed
feat: Add Configurable GeneratorURL Templates for Alerts#737ramessesii2 wants to merge 7 commits into
ramessesii2 wants to merge 7 commits into
Conversation
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>
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>
Contributor
Author
|
closing in favor of #798 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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