Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard Title Slug does not support the mix of English and Chinese in 9.4.1 #66373

Closed
alexandnpu opened this issue Apr 12, 2023 · 9 comments · Fixed by #70691
Closed

Dashboard Title Slug does not support the mix of English and Chinese in 9.4.1 #66373

alexandnpu opened this issue Apr 12, 2023 · 9 comments · Fixed by #70691

Comments

@alexandnpu
Copy link

alexandnpu commented Apr 12, 2023

What happened:
When I create a dashboard with one title consisting both English and Chinese,the dashboard slug after creation will ignore the Chinese part. This prevents making the second dashboard with the same English prefix.

e.g.
the first dashboard title is "aws测试", the second dashboard title is "aws生产".
The first dashboard will be created with no error, while the second one will cause a dashboard conflict warning.

What you expected to happen:
The second dashboard will be created with no error or warning.

I went through the code, and found the slug change
and this PR.

It seems that the slug change causes this unexpected behavior.

I did a test in TestSlugifyTitle, which is my input and expected result.
image

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Grafana version: 9.4.1
  • Data source type & version:
  • OS Grafana is installed on: centos7
  • User OS & Browser:
  • Grafana plugins:
  • Others:
@tonypowa
Copy link
Contributor

thank you for creating this issue @alexandnpu

I am forwarding it to the dataviz squad for review ( PR was assigned to this squad)

@alexandnpu
Copy link
Author

@tonypowa , thanks a lot! Will updates be put here?

@tonypowa
Copy link
Contributor

@alexandnpu

yes, the team will review this issue, and inform you on the next steps
👍

@tonypowa tonypowa added the triage/needs-confirmation used for OSS triage rotation - reported issue needs to be reproduced label Apr 21, 2023
@skyhotqin
Copy link

skyhotqin commented Jun 1, 2023

@alexandnpu

@tonypowa , thanks a lot! Will updates be put here?

I'm also in this trouble, how did you deal with this bug? have any solutions?
otherwise, I think this code will help to deal with it.

@papagian papagian added type/bug and removed triage/needs-confirmation used for OSS triage rotation - reported issue needs to be reproduced labels Jun 2, 2023
@alexandnpu
Copy link
Author

@alexandnpu

@tonypowa , thanks a lot! Will updates be put here?

I'm also in this trouble, how did you deal with this bug? have any solutions? otherwise, I think this code will help to deal with it.

for users, I have no workaround right now. The suggestion for users is to avoid using the mixture of Chinese and English, use all Chinese instead.

I am still waiting for the fix of grafana team.

@Joey777210
Copy link

Same issue

@baosenle
Copy link

Same issue

@yatt
Copy link

yatt commented Jun 27, 2023

I've encountered the similar issue in Japanese: importing the dashboard overwrite the existing one.

In the older version of Grafana, based on the migration data I examined, even when Japanese was used, Romaji and Chinese Pinyin was assigned, which functioned as a unique ID, at least.
For example, there was a dashboard titled 'システム監視(Prometheus)' in Japanese, and it had the slug 'shisutemujian-shi-prometheus' assigned to it.

As a workaround, I directly updated the slug value in the database record, allowing me to successfully import the dashboard.
I'm not sure about any other potential impacts caused by this.

$ sqlite3 grafana.db
sqlite> select id, title, slug from dashboard order by title;
...
94|PostgreSQL関係の統計値|postgresql
...
sqlite> update dashboard set slug = 'postgresql-related-stats' where id=94;

Environment:

Grafana version: 10.0.1
Data source type & version:
OS Grafana is installed on: Windows10 Pro
User OS & Browser:
Grafana plugins:
Others:

@sakjur
Copy link
Contributor

sakjur commented Jun 28, 2023

@yatt 🙏 Thank you for bringing that up too, we've tracked down that issue to a function using the slug rather than title to look for whether the dashboard already exists when updating it. That should be fixed by #70723.

I'll try to summarize a little bit of what's been happening with the slugs (mostly for developers working on permutations of this issue, but also for anyone interested):

(cc @yangkb09 @zserge)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants