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

'Prettify query' causes many wrong transformations to the JSON #242

Open
maxb opened this issue Jan 10, 2025 · 0 comments
Open

'Prettify query' causes many wrong transformations to the JSON #242

maxb opened this issue Jan 10, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@maxb
Copy link

maxb commented Jan 10, 2025

  1. Create a simple dashboard, containing a single timeseries panel, querying a single metric - my MetricsQL was simply shelf_fan_labels.
  2. Save dashboard.
  3. Click 'Prettify query' button.
  4. Click to save the dashboard and review the JSON changes about to be saved

The in-Grafana diff of the JSON changes is not presented well, so I pulled the relevant parts out to JSON files and diffed them manually...

--- targets1.json       2025-01-10 14:03:51.913508789 +0000
+++ targets2.json       2025-01-10 14:04:14.499938871 +0000
@@ -1,14 +1,23 @@
 {
   "targets": [
     {
-      "datasource": {
-        "type": "victoriametrics-datasource",
-        "uid": "PC4C83B0CAD5B2BCA"
-      },
-      "editorMode": "code",
+      "0": "s",
+      "1": "h",
+      "2": "e",
+      "3": "l",
+      "4": "f",
+      "5": "_",
+      "6": "f",
+      "7": "a",
+      "8": "n",
+      "9": "_",
+      "10": "l",
+      "11": "a",
+      "12": "b",
+      "13": "e",
+      "14": "l",
+      "15": "s",
       "expr": "shelf_fan_labels",
-      "legendFormat": "__auto",
-      "range": true,
       "refId": "A"
     }
   ]

The 'Prettify query' operation:

  • Added a bizarre extra representation of the query in lots of single-character strings
  • Deleted various other settings, which included functionally changing the legend from 'Auto' to 'Verbose' mode

It shouldn't be doing any of that.

@Loori-R Loori-R self-assigned this Jan 15, 2025
@Loori-R Loori-R added the bug Something isn't working label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants