You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by "mcseemz (via GitHub)" <gi...@apache.org> on 2026/04/09 22:15:51 UTC

[I] [Bug][Grafana] team-related dashboards are failing with non-numeric IDs [incubator-devlake]

mcseemz opened a new issue, #8829:
URL: https://github.com/apache/incubator-devlake/issues/8829

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   With the properly configured teams Grafana Work Logs dashboard could not select user after team selection, and then could not produce any data on a panel. I suspect there are a number of other boards with the same problem.
   
   <img width="375" height="63" alt="Image" src="https://github.com/user-attachments/assets/358047a1-da2c-433f-a3ba-76ab992dcdc8" />
   
   ### What do you expect to happen
   
   User dropdown works successfully, leading to proper data in panels for all boards relying on "teams" and "users" DB tables
   
   ### How to reproduce
   
   Problem is with the teams' and users' IDs. DB fields for those are `varchar(255)`, so we can put any string there (although examples are with numbers only for some reasons). [Documentation](https://devlake.apache.org/docs/v0.15/UserManuals/TeamConfiguration) says nothing about field contents.
   And then dashboard' variables and panels do not quote these IDs data in SQL, e.g.:
   https://github.com/apache/incubator-devlake/blob/main/grafana/dashboards/WorkLogs.json#L1447
   ```
   "query": "select concat(users.name, '--', users.id) from users left join team_users on users.id = team_users.user_id where team_users.team_id in ($team)",
   ```
   So it works well only with numbers right now, as they are injected safely. Please decide, either numbers only, or string support in grafana (I would vote for the second).
   
   ### Anything else
   
   The [regexp logic](https://github.com/apache/incubator-devlake/blob/adaa0085711687f52b991f0347479496d0a0de3d/grafana/dashboards/WorkLogs.json#L1449) applied to the dashboard variables to compile proper dropdown implies bit does not state anywhere that team or user ID should not contain `--` , or everything will break apart.
   
   ### Version
   
   v1.0.3-beta10
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][Grafana] team-related dashboards are failing with non-numeric IDs [devlake]

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh closed issue #8829: [Bug][Grafana] team-related dashboards are failing with non-numeric IDs
URL: https://github.com/apache/devlake/issues/8829


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][Grafana] team-related dashboards are failing with non-numeric IDs [incubator-devlake]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #8829:
URL: https://github.com/apache/incubator-devlake/issues/8829#issuecomment-4218044932

   <!-- Greeting -->
   Hi @mcseemz! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the incubator-devlake team.
   
   <!-- Answer -->
   This looks like a valid bug. The core issue is that Grafana's multi-value variable substitution for `$team` (and `$users`) injects raw values into SQL `IN` clauses without quoting, which breaks when IDs are non-numeric strings.
   
   I confirmed the problem exists in multiple dashboards:
   
   - **WorkLogs.json** — the `$users` variable query uses `team_users.team_id in ($team)` without quoting [[1]](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json#L1440), and panel queries similarly use `ua.user_id in ($users)` unquoted [[2]](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json#L219).
   - **DORAByTeam.json** — has at least 9 instances of `t.name in (${team})` without quoting across all DORA metric queries [[3]](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/DORAByTeam.json#L209).
   - **EngineeringThroughputAndCycleTimeTeamView.json** — uses `team_id in (${team1})` without quoting [[4]](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/EngineeringThroughputAndCycleTimeTeamView.json#L213).
   
   Grafana's MySQL datasource *does* support quoting for multi-value string variables — you need to wrap the variable with single quotes and use the `Include All` option correctly. The typical fix is to change queries from:
   
   ```sql
   WHERE team_users.team_id in ($team)
   ```
   
   to:
   
   ```sql
   WHERE team_users.team_id in (${team:singlequote})
   ```
   
   Or alternatively, the Grafana variable's "Custom all value" and formatting can handle this via the `${variable:sqlstring}` or `${variable:singlequote}` syntax depending on the Grafana version.
   
   Additionally, as you noted, the `--` delimiter used in the concat-regex pattern (`concat(name, '--', id)` with regex `/^(?<text>.*)--(?<value>.*)$/`) will break if team or user IDs contain `--` [[5]](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json#L1447-L1449). Using a less common delimiter or documenting this restriction would help.
   
   No existing PRs or prior conversations addressing this were found, so this appears to be a new report.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=ebaf7d1c-bf36-489a-8e26-7f77f83afbda&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=ebaf7d1c-bf36-489a-8e26-7f77f83afbda&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=ebaf7d1c-bf36-489a-8e26-7f77f83afbda&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=ebaf7d1c-bf36-489a-8e26-7f77f83afbda&feedback_type=too_verbose) | [Hallucination](https://
 app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=ebaf7d1c-bf36-489a-8e26-7f77f83afbda&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=ebaf7d1c-bf36-489a-8e26-7f77f83afbda&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=ebaf7d1c-bf36-489a-8e26-7f77f83afbda&feedback_type=other)</sup>
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20looks%20like%20a%20valid%20bug.%20The%20core%20issue%20is%20that%20Grafana%27s%20multi-value%20variable%20substitution%20for%20%60%24team%60%20%28and%20%60%24users%60%29%20injects%20raw%20values%20into%20SQL%20%60IN%60%20clauses%20without%20quoting%2C%20which%20breaks%20when%20IDs%20are%20non-numeric%20strings.%0A%0AI%20confirmed%20the%20problem%20exists%20in%20multiple%20dashboards%3A%0A%0A-%20%2A%2AWorkLogs.json%2A%2A%20%E2%80%94%20the%20%60%24users%60%20variable%20query%20uses%20%60team_users.team_id%20in%20%28%24team%29%60%20without%20quoting%20%5B%5B1%5D%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dash
 boards/WorkLogs.json%23L1440%29%2C%20and%20panel%20queries%20similarly%20use%20%60ua.user_id%20in%20%28%24users%29%60%20unquoted%20%5B%5B2%5D%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json%23L219%29.%0A-%20%2A%2ADORAByTeam.json%2A%2A%20%E2%80%94%20has%20at%20least%209%20instances%20of%20%60t.name%20in%20%28%24%7Bteam%7D%29%60%20without%20quoting%20across%20all%20DORA%20metric%20queries%20%5B%5B3%5D%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/DORAByTeam.json%23L209%29.%0A-%20%2A%2AEngineeringThroughputAndCycleTimeTeamView.json%2A%2A%20%E2%80%94%20uses%20%60team_id%20in%20%28%24%7Bteam1%7D%29%60%20without%20quoting%20%5B%5B4%5D%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/EngineeringThroughputAndCycleTimeTeamView.json%23L213%29.%0A%0AGrafana%27s%20MySQL%20datasou
 rce%20%2Adoes%2A%20support%20quoting%20for%20multi-value%20string%20variables%20%E2%80%94%20you%20need%20to%20wrap%20the%20variable%20with%20single%20quotes%20and%20use%20the%20%60Include%20All%60%20option%20correctly.%20The%20typical%20fix%20is%20to%20change%20queries%20from%3A%0A%0A%60%60%60sql%0AWHERE%20team_users.team_id%20in%20%28%24team%29%0A%60%60%60%0A%0Ato%3A%0A%0A%60%60%60sql%0AWHERE%20team_users.team_id%20in%20%28%24%7Bteam%3Asinglequote%7D%29%0A%60%60%60%0A%0AOr%20alternatively%2C%20the%20Grafana%20variable%27s%20%22Custom%20all%20value%22%20and%20formatting%20can%20handle%20this%20via%20the%20%60%24%7Bvariable%3Asqlstring%7D%60%20or%20%60%24%7Bvariable%3Asinglequote%7D%60%20syntax%20depending%20on%20the%20Grafana%20version.%0A%0AAdditionally%2C%20as%20you%20noted%2C%20the%20%60--%60%20delimiter%20used%20in%20the%20concat-regex%20pattern%20%28%60concat%28name%2C%20%27--%27%2C%20id%29%60%20with%20regex%20%60/%5E%28%3F%3Ctext%3E.%2A%29--%28%3F%3Cvalue%3E.%2A%29%24/%60%29%2
 0will%20break%20if%20team%20or%20user%20IDs%20contain%20%60--%60%20%5B%5B5%5D%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json%23L1447-L1449%29.%20Using%20a%20less%20common%20delimiter%20or%20documenting%20this%20restriction%20would%20help.%0A%0ANo%20existing%20PRs%20or%20prior%20conversations%20addressing%20this%20were%20found%2C%20so%20this%20appears%20to%20be%20a%20new%20report.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8829)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][Grafana] team-related dashboards are failing with non-numeric IDs [devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8829:
URL: https://github.com/apache/devlake/issues/8829#issuecomment-4828118804

   This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org