Add per-tenant Grafana Explore URL format for alert GeneratorURL#7302
Open
CharlieTLe wants to merge 2 commits intocortexproject:masterfrom
Open
Add per-tenant Grafana Explore URL format for alert GeneratorURL#7302CharlieTLe wants to merge 2 commits intocortexproject:masterfrom
CharlieTLe wants to merge 2 commits intocortexproject:masterfrom
Conversation
Add support for tenants to configure alert GeneratorURL to use Grafana Explore format instead of the default Prometheus /graph format. This is controlled by three new per-tenant settings: ruler_alert_generator_url_format, ruler_grafana_datasource_uid, and ruler_grafana_org_id. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Charlie Le <charlie_le@apple.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Charlie Le <charlie_le@apple.com>
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.
Summary
GeneratorURLto use Grafana Explore format instead of the default Prometheus/graphformatruler_alert_generator_url_format,ruler_grafana_datasource_uid, andruler_grafana_org_idruler_external_urloverride so tenants can have different external URLs without changing the global ruler configWhen
ruler_alert_generator_url_formatis set tografana-explore, the GeneratorURL in fired alerts becomes a Grafana Explore link (e.g.http://grafana:3000/explore?schemaVersion=1&panes=...&orgId=1) with the alert expression and datasource UID pre-filled. Clicking "See source" on an alert in Grafana opens Explore with the correct query, datasource, and time range.New per-tenant config options
ruler_external_url""(uses global)ruler_alert_generator_url_formatprometheusorgrafana-explore""(prometheus)ruler_grafana_datasource_uid""ruler_grafana_org_id1Example runtime config
Test plan
grafanaExploreLinkURL generation with various expressions and special charactersuserExternalURLtracking per-tenant URL changesSendAlertswith custom generator URL functiongrafana-exploreformat — confirmed the "See source" link opens Grafana Explore with correct datasource and query🤖 Generated with Claude Code