feat: integrate Grafana Dashboard monitoring into Web UI#4868
Open
m199369309 wants to merge 4 commits intoxorbitsai:mainfrom
Open
feat: integrate Grafana Dashboard monitoring into Web UI#4868m199369309 wants to merge 4 commits intoxorbitsai:mainfrom
m199369309 wants to merge 4 commits intoxorbitsai:mainfrom
Conversation
Add a new "Monitoring" page that embeds a Grafana Dashboard via iframe, along with a backend API endpoint to supply Grafana configuration from environment variables. This enables users to view Prometheus metrics (cluster overview, worker resources, model service quality, LLM-specific metrics) directly within the xinference Web UI. Changes: - Backend: add `/v1/cluster/ui_config` endpoint returning Grafana URL, datasource, dashboard UID, and cluster name from env vars - Frontend: new `grafanaUtils.js` utility for building iframe URLs with theme and variable support - Frontend: new `/monitoring` route and page component with theme-following - Frontend: add "Monitoring" menu item to sidebar navigation - i18n: add monitoring-related translations (en/zh/ja/ko) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
qinxuye
reviewed
Apr 29, 2026
| "collapsed": false, | ||
| "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, | ||
| "id": 100, | ||
| "title": "集群概览", |
Contributor
There was a problem hiding this comment.
Could you change to English?
| "collapsed": false, | ||
| "gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 }, | ||
| "id": 101, | ||
| "title": "Worker 资源", |
| }, | ||
| { | ||
| "id": 4, | ||
| "title": "GPU 利用率", |
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
/v1/cluster/ui_configbackend endpoint that returns Grafana configuration from environment variables (XINFERENCE_GRAFANA_URL,XINFERENCE_GRAFANA_DATASOURCE,XINFERENCE_GRAFANA_DASHBOARD_UID,XINFERENCE_CLUSTER_NAME)/monitoring) that embeds a Grafana Dashboard via iframe withkiosk=tvmode, theme-following (light/dark), and variable pass-throughgrafanaUtils.jsutility for building Grafana iframe URLs (full dashboard + single panel embed)Motivation
After #4857 added comprehensive Prometheus metrics, users need a way to visualize these metrics directly within the xinference Web UI without switching to a separate Grafana instance. This PR embeds Grafana Dashboards via iframe, providing a seamless monitoring experience.
Configuration
XINFERENCE_GRAFANA_URL""XINFERENCE_GRAFANA_DATASOURCE""XINFERENCE_GRAFANA_DASHBOARD_UIDxinference-overviewXINFERENCE_CLUSTER_NAME""Test plan
/v1/cluster/ui_configreturns correct JSON with/without env vars set/monitoringpage loads and displays Grafana Dashboard when configuredXINFERENCE_GRAFANA_URLis empty