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

Azure Data Explorer panel editor keeps reverting "Format as" to "Time series" when I open the panel editor #561

Closed
sandersaares opened this issue Feb 15, 2023 · 0 comments · Fixed by #562
Assignees
Labels

Comments

@sandersaares
Copy link

What happened:

Whenever I open the editor GUI for a panel with an Azure Data Explorer query and the "ADX Time series" option selected under "Format as", it reverts to "Time series" option.

Starting state:

image

After apply + edit it has reverted:

image

What you expected to happen:

"Format as" keeps using the option I have selected until I change it myself.

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

  1. Create Azure Data Explorer query in panel.
  2. Set "Format as" to "ADX Time series".
  3. Hit apply.
  4. Open the panel for editing.
  5. Observe it has reverted to "Time series".

Anything else we need to know?:

Environment:

  • Grafana version: 9.3.2.2
  • Data source type & version: Azure Data Explorer 4.2.0
  • OS Grafana is installed on: Azure
  • User OS & Browser:
  • Grafana plugins:
  • Others:
Key Value
Panel timeseries @ 9.3.2.2 (67a213dc85)
Grafana 9.3.2.2 (67a213dc85) // Pro
Panel debug snapshot dashboard
{
  "panels": [
    {
      "id": 2,
      "gridPos": {
        "h": 13,
        "w": 15,
        "x": 0,
        "y": 0
      },
      "type": "timeseries",
      "title": "Reproduced with embedded data",
      "datasource": {
        "type": "grafana",
        "uid": "grafana"
      },
      "targets": [
        {
          "refId": "A",
          "datasource": {
            "type": "grafana",
            "uid": "grafana"
          },
          "queryType": "snapshot",
          "snapshot": [
            {
              "schema": {
                "refId": "A",
                "meta": {
                  "executedQueryString": "simkit\n| where timestamp >= datetime(2000-01-01T00:03:04.186Z) and timestamp <= datetime(2000-01-01T00:03:43.912Z)\n| where name in ('simkit_time_synchronous_timers_total', 'simkit_time_asynchronous_timers_total', 'simkit_time_delays_total')\n| where simulation_id == '1676445720-6e04fdc7-e3e7-45e6-8558-109f2804d1fd'\n| partition by name\n(\n  sort by timestamp asc\n  | make-series bucket_min=min(value) on timestamp step 1s by name\n  | extend next_bucket_min = array_shift_left(bucket_min, 1)\n  | extend bucket_delta = series_subtract(next_bucket_min, bucket_min)\n  | extend Timestamp = timestamp\n  | project-away bucket_min, next_bucket_min, timestamp\n)"
                },
                "fields": [
                  {
                    "name": "Timestamp",
                    "type": "time",
                    "typeInfo": {
                      "frame": "time.Time"
                    },
                    "config": {}
                  },
                  {
                    "name": "bucket_delta",
                    "type": "number",
                    "typeInfo": {
                      "frame": "float64",
                      "nullable": true
                    },
                    "labels": {
                      "name": "simkit_time_delays_total"
                    },
                    "config": {}
                  },
                  {
                    "name": "bucket_delta",
                    "type": "number",
                    "typeInfo": {
                      "frame": "float64",
                      "nullable": true
                    },
                    "labels": {
                      "name": "simkit_time_synchronous_timers_total"
                    },
                    "config": {}
                  },
                  {
                    "name": "bucket_delta",
                    "type": "number",
                    "typeInfo": {
                      "frame": "float64",
                      "nullable": true
                    },
                    "labels": {
                      "name": "simkit_time_asynchronous_timers_total"
                    },
                    "config": {}
                  }
                ]
              },
              "data": {
                "values": [
                  [
                    946684985000,
                    946684986000,
                    946684987000,
                    946684988000,
                    946684989000,
                    946684990000,
                    946684991000,
                    946684992000,
                    946684993000,
                    946684994000,
                    946684995000,
                    946684996000,
                    946684997000,
                    946684998000,
                    946684999000,
                    946685000000,
                    946685001000,
                    946685002000,
                    946685003000,
                    946685004000,
                    946685005000,
                    946685006000,
                    946685007000,
                    946685008000,
                    946685009000,
                    946685010000,
                    946685011000,
                    946685012000,
                    946685013000,
                    946685014000,
                    946685015000,
                    946685016000,
                    946685017000,
                    946685018000,
                    946685019000,
                    946685020000,
                    946685021000,
                    946685022000,
                    946685023000
                  ],
                  [
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    null
                  ],
                  [
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    1000,
                    null
                  ],
                  [
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    null
                  ]
                ]
              }
            }
          ]
        }
      ],
      "options": {
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        },
        "legend": {
          "showLegend": true,
          "displayMode": "list",
          "placement": "bottom",
          "calcs": []
        }
      },
      "fieldConfig": {
        "defaults": {
          "custom": {
            "drawStyle": "line",
            "lineInterpolation": "linear",
            "barAlignment": 0,
            "lineWidth": 1,
            "fillOpacity": 0,
            "gradientMode": "none",
            "spanNulls": false,
            "showPoints": "auto",
            "pointSize": 5,
            "stacking": {
              "mode": "none",
              "group": "A"
            },
            "axisPlacement": "auto",
            "axisLabel": "",
            "axisColorMode": "text",
            "scaleDistribution": {
              "type": "linear"
            },
            "axisCenteredZero": false,
            "hideFrom": {
              "tooltip": false,
              "viz": false,
              "legend": false
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "value": null,
                "color": "green"
              },
              {
                "value": 80,
                "color": "red"
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "bucket_delta simkit_time_asynchronous_timers_total"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Asynchronous timers"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "bucket_delta simkit_time_delays_total"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Asynchronous delays"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "bucket_delta simkit_time_synchronous_timers_total"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Synchronous timers and delays"
              }
            ]
          }
        ]
      }
    },
    {
      "gridPos": {
        "h": 7,
        "w": 9,
        "x": 15,
        "y": 0
      },
      "id": 5,
      "options": {
        "content": "<table width=\"100%\">\n    <tr>\n      <th width=\"2%\">Panel</th>\n      <td >timeseries @ 9.3.2.2 (67a213dc85)</td>\n    </tr>\n    <tr>\n      <th>Queries</th>\n      <td>A[grafana-azure-data-explorer-datasource]</td>\n    </tr>\n    \n    <tr><th>Data</th><td> 1 frames, 4 fields, 39 rows </td></tr>\n    \n    <tr>\n      <th>Grafana</th>\n      <td>9.3.2.2 (67a213dc85) // Pro</td>\n    </tr>\n  </table>",
        "mode": "html"
      },
      "title": "Debug info",
      "type": "text"
    },
    {
      "id": 6,
      "title": "Original Panel JSON",
      "type": "text",
      "gridPos": {
        "h": 13,
        "w": 9,
        "x": 15,
        "y": 7
      },
      "options": {
        "content": "{\n  \"id\": 10,\n  \"gridPos\": {\n    \"x\": 6,\n    \"y\": 16,\n    \"w\": 12,\n    \"h\": 8\n  },\n  \"type\": \"timeseries\",\n  \"title\": \"New scheduling operations (1/sec) variant B (ADX timeseries)\",\n  \"datasource\": {\n    \"uid\": \"u4kH7I14k\",\n    \"type\": \"grafana-azure-data-explorer-datasource\"\n  },\n  \"targets\": [\n    {\n      \"datasource\": {\n        \"type\": \"grafana-azure-data-explorer-datasource\",\n        \"uid\": \"u4kH7I14k\"\n      },\n      \"query\": \"simkit\\n| where $__timeFilter(timestamp)\\n| where name in ('simkit_time_synchronous_timers_total', 'simkit_time_asynchronous_timers_total', 'simkit_time_delays_total')\\n| where simulation_id == '$simulation_id'\\n| partition by name\\n(\\n  sort by timestamp asc\\n  | make-series bucket_min=min(value) on timestamp step 1s by name\\n  | extend next_bucket_min = array_shift_left(bucket_min, 1)\\n  | extend bucket_delta = series_subtract(next_bucket_min, bucket_min)\\n  | extend Timestamp = timestamp\\n  | project-away bucket_min, next_bucket_min, timestamp\\n)\",\n      \"querySource\": \"raw\",\n      \"expression\": {\n        \"where\": {\n          \"type\": \"and\",\n          \"expressions\": []\n        },\n        \"groupBy\": {\n          \"type\": \"and\",\n          \"expressions\": []\n        },\n        \"reduce\": {\n          \"type\": \"and\",\n          \"expressions\": []\n        }\n      },\n      \"pluginVersion\": \"4.2.0\",\n      \"refId\": \"A\",\n      \"rawMode\": true,\n      \"resultFormat\": \"time_series_adx_series\",\n      \"database\": \"feb23\"\n    }\n  ],\n  \"options\": {\n    \"tooltip\": {\n      \"mode\": \"multi\",\n      \"sort\": \"desc\"\n    },\n    \"legend\": {\n      \"showLegend\": true,\n      \"displayMode\": \"list\",\n      \"placement\": \"bottom\",\n      \"calcs\": []\n    }\n  },\n  \"fieldConfig\": {\n    \"defaults\": {\n      \"custom\": {\n        \"drawStyle\": \"line\",\n        \"lineInterpolation\": \"linear\",\n        \"barAlignment\": 0,\n        \"lineWidth\": 1,\n        \"fillOpacity\": 0,\n        \"gradientMode\": \"none\",\n        \"spanNulls\": false,\n        \"showPoints\": \"auto\",\n        \"pointSize\": 5,\n        \"stacking\": {\n          \"mode\": \"none\",\n          \"group\": \"A\"\n        },\n        \"axisPlacement\": \"auto\",\n        \"axisLabel\": \"\",\n        \"axisColorMode\": \"text\",\n        \"scaleDistribution\": {\n          \"type\": \"linear\"\n        },\n        \"axisCenteredZero\": false,\n        \"hideFrom\": {\n          \"tooltip\": false,\n          \"viz\": false,\n          \"legend\": false\n        },\n        \"thresholdsStyle\": {\n          \"mode\": \"off\"\n        }\n      },\n      \"color\": {\n        \"mode\": \"palette-classic\"\n      },\n      \"mappings\": [],\n      \"thresholds\": {\n        \"mode\": \"absolute\",\n        \"steps\": [\n          {\n            \"value\": null,\n            \"color\": \"green\"\n          },\n          {\n            \"value\": 80,\n            \"color\": \"red\"\n          }\n        ]\n      },\n      \"unit\": \"short\"\n    },\n    \"overrides\": [\n      {\n        \"matcher\": {\n          \"id\": \"byName\",\n          \"options\": \"bucket_delta simkit_time_asynchronous_timers_total\"\n        },\n        \"properties\": [\n          {\n            \"id\": \"displayName\",\n            \"value\": \"Asynchronous timers\"\n          }\n        ]\n      },\n      {\n        \"matcher\": {\n          \"id\": \"byName\",\n          \"options\": \"bucket_delta simkit_time_delays_total\"\n        },\n        \"properties\": [\n          {\n            \"id\": \"displayName\",\n            \"value\": \"Asynchronous delays\"\n          }\n        ]\n      },\n      {\n        \"matcher\": {\n          \"id\": \"byName\",\n          \"options\": \"bucket_delta simkit_time_synchronous_timers_total\"\n        },\n        \"properties\": [\n          {\n            \"id\": \"displayName\",\n            \"value\": \"Synchronous timers and delays\"\n          }\n        ]\n      }\n    ]\n  }\n}",
        "mode": "code",
        "code": {
          "language": "json",
          "showLineNumbers": true,
          "showMiniMap": true
        }
      }
    },
    {
      "id": 3,
      "title": "Data from panel above",
      "type": "table",
      "datasource": {
        "type": "datasource",
        "uid": "-- Dashboard --"
      },
      "gridPos": {
        "h": 7,
        "w": 15,
        "x": 0,
        "y": 13
      },
      "options": {
        "showTypeIcons": true
      },
      "targets": [
        {
          "datasource": {
            "type": "datasource",
            "uid": "-- Dashboard --"
          },
          "panelId": 2,
          "withTransforms": true,
          "refId": "A"
        }
      ]
    }
  ],
  "schemaVersion": 37,
  "title": "Debug: New scheduling operations (1/sec) variant B (ADX timeseries) // 2023-02-15 12:41:27",
  "tags": [
    "debug",
    "debug-timeseries"
  ],
  "time": {
    "from": "2000-01-01T00:03:04.186Z",
    "to": "2000-01-01T00:03:43.912Z"
  }
}
@alyssabull alyssabull transferred this issue from grafana/grafana Mar 1, 2023
@alyssabull alyssabull assigned alyssabull and unassigned alyssabull Mar 1, 2023
@alyssabull alyssabull added the type/bug Something isn't working label Mar 1, 2023
@alyssabull alyssabull self-assigned this Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants