Repository navigation
Conversation
With USE_EXTERNAL_GRAFANA=true, nginx redirected every /grafana/... request to GRAFANA_ENDPOINT and dropped the path and query, so all dashboard links (e.g. /grafana/d/<uid>/...) ended on the Grafana home page. The redirect now keeps the path after /grafana and the query string ($request_uri, still URL-encoded). A trailing slash in GRAFANA_ENDPOINT is ignored. Proxy mode is unchanged. The onboarding "Check Dashboard" button opened DEVLAKE_DASHBOARD_URL_*, which are build-time variables and are not set in the released image, so the button opened an empty tab. If no URL is configured, it now opens the Grafana dashboard search for the plugin (e.g. /grafana/dashboards?query=GitHub), which works for MySQL and PostgreSQL (PostgreSQL dashboards use "-pg" UIDs). Also document USE_EXTERNAL_GRAFANA in config-ui/README.md and the PostgreSQL UIDs in config-ui/env.example. Refs apache#9219 Signed-off-by: DoDiODev <DoDiDev@proton.me>
7 of 12 tasks
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
Fixes two bugs with the Grafana links of the config-ui. Part of #9219
(section B). Defaults and proxy mode are unchanged.
External Grafana redirect keeps path and query
With
USE_EXTERNAL_GRAFANA=true,nginx.confanswered every/grafana/...request with
302 ${GRAFANA_ENDPOINT}and dropped the path and the query. Alldashboard links (e.g.
/grafana/d/<uid>/<slug>?orgId=1) therefore ended on theGrafana home page.
/grafanafrom$request_uri(still URL-encoded, query string included), via a
mapinnginx.conf.nginx.shdrops a trailing slash fromGRAFANA_ENDPOINT, sohttps://grafana.example.com/does not produce//."Check Dashboard" button in the onboarding
The button opened
import.meta.env.DEVLAKE_DASHBOARD_URL_*. These arebuild-time variables; the released image is built without them, so the button
opened an empty tab. The example values in
config-ui/env.examplealso pointto the MySQL dashboard UIDs, while the PostgreSQL dashboards use a
-pgsuffix.
getDashboardURL(plugin): uses the configured URL if set, otherwise theGrafana dashboard search for the plugin (e.g.
/grafana/dashboards?query=GitHub, respectingDEVLAKE_GRAFANA_PATH). Thetitles are the same for MySQL and PostgreSQL, so this works for both.
Docs
config-ui/README.md:GRAFANA_ENDPOINT/USE_EXTERNAL_GRAFANAin theDocker image.
config-ui/env.example: the dashboard URLs are optional, and thePostgreSQL UIDs use the
-pgsuffix.Does this close any open issues?
Part of #9219 (section B).
Screenshots
N/A
Other Information
Tested with the image built from this branch and from
main(ee0079ab3):main/grafana/d/KXWvOFQnz-pg/github?orgId=1&var-repo_id=Allhttps://grafana.example.com/https://grafana.example.com/d/KXWvOFQnz-pg/github?orgId=1&var-repo_id=Allvar-repo=a%20b&var-team=%2Fdev)GRAFANA_ENDPOINT=https://example.com/grafana)https://example.com/grafanahttps://example.com/grafana/d/…/grafana//grafana/, SPA routeThe search URL was checked against Grafana 13.2.3 in a headless browser:
/dashboards?query=GitHublists only the matching dashboard.tsc,eslint,vitestandvite buildpass. Full CI mirror on my fork:run