Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug][Grafana] Redundant root grafana-irm.json causes dashboard UID collisions in MySQL and phantom dashboard in PostgreSQL

未关闭 适合新手
#9,175 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
95/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, grafana

调研方向

先检查 grafana/dashboards/grafana-irm.json 以及各 dialect 专用的 dashboards,然后查看 grafana/Dockerfile 和 entrypoint.sh,以确认 provisioning 路径是如何复制和过滤的。删除根目录中冗余的 dashboard 文件,并验证对于每个 DATABASE_TYPE,只保留 MySQL 或 PostgreSQL dashboard;文档中所述的 Docker 构建和启动检查应显示不存在 UID 冲突或虚假 dashboard。

由索引模型根据 Issue 内容生成。

描述

type/bug
Search before asking
  • I had searched in the issues and found no similar issues.
What happened

Following the merge of PR #9160, the new Grafana IRM dashboard was added to dialect-specific directories (grafana/dashboards/mysql/grafana-irm.json and grafana/dashboards/postgresql/grafana-irm.json), but a duplicate file was also left at the root level in grafana/dashboards/grafana-irm.json.

In the container build (grafana/Dockerfile), the entire dashboards directory is copied into /etc/grafana/dashboards.

  1. MySQL mode (DATABASE_TYPE=mysql):

    • entrypoint.sh removes /etc/grafana/dashboards/postgresql.
    • Both /etc/grafana/dashboards/grafana-irm.json and /etc/grafana/dashboards/mysql/grafana-irm.json remain on disk with the identical UID: "uid": "grafana-irm-dashboard".
    • Grafana's file provider provisions dashboards recursively, encountering both files and throwing a duplicate UID collision:
      logger=provisioning.dashboard type=file name="My Dashboard" level=error msg="failed to load dashboard from file" file=/etc/grafana/dashboards/grafana-irm.json error="dashboard with uid 'grafana-irm-dashboard' already exists"
      
  2. PostgreSQL mode (DATABASE_TYPE=postgresql):

    • entrypoint.sh removes /etc/grafana/dashboards/mysql.
    • Both /etc/grafana/dashboards/postgresql/grafana-irm.json (UID grafana-irm-dashboard-pg) and the stray root /etc/grafana/dashboards/grafana-irm.json (UID grafana-irm-dashboard) are loaded under the same title "Grafana IRM".
    • The root dashboard attempts to query the MySQL datasource (devlake-mysql-api), which does not exist in PostgreSQL mode, resulting in a duplicate broken dashboard in the Grafana UI.
What do you expect to happen

Each dashboard file should only exist within its designated dialect folder (grafana/dashboards/mysql/ or grafana/dashboards/postgresql/). No duplicate files should reside in the root grafana/dashboards/ directory so that provisioning loads each dashboard exactly once without UID conflicts or cross-dialect query errors.

How to reproduce
  1. Inspect the repository at grafana/dashboards/ or build and run the Grafana container:
    docker build -t devlake-dashboard:test grafana/
    docker run --rm -e DATABASE_TYPE=mysql devlake-dashboard:test
    
  2. Verify that both /etc/grafana/dashboards/grafana-irm.json and /etc/grafana/dashboards/mysql/grafana-irm.json exist.
  3. Observe the Grafana startup logs indicating a duplicate dashboard UID error for grafana-irm-dashboard.
  4. Alternatively, run with -e DATABASE_TYPE=postgresql and check the dashboard list in the Grafana UI; observe two "Grafana IRM" dashboards, with the root one failing due to missing devlake-mysql-api.
Anything else
  • Affected file to be removed: grafana/dashboards/grafana-irm.json
  • Active dialect dashboards:
    • grafana/dashboards/mysql/grafana-irm.json (MySQL datasource)
    • grafana/dashboards/postgresql/grafana-irm.json (PostgreSQL datasource)
  • grafana/dashboards/grafana-irm.json and grafana/dashboards/mysql/grafana-irm.json are byte-for-byte identical; removing the root file cleanly eliminates the collision without impacting MySQL or PostgreSQL dashboard provisioning.
Version

b0a758996 (commit on main following PR #9160 / #9173)

Are you willing to submit PR?
  • Yes I am willing to submit a PR!
Code of Conduct
主要语言
Go
星标
3.1k
派生
812
平均合并
2 天 8 小时
30 天内合并 PR
51

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/devlake 的其他 Issue

查看 apache/devlake 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。