flant / grafana-statusmap

Grafana panel plugin to visualize status of multiple objects over time
MIT License
830 stars 41 forks source link

Problem with the time scale display when the dashboard time zone is changed. #303

Open shale-rims opened 1 year ago

shale-rims commented 1 year ago

What happened: When you change the dashboard time zone between browser and UTC, the dashboard displays the correct time. When you change the dashboard time zone to any time other than Browser or UTC - the panel shows the time in the Browser timezone.

Timezone settings:
Browser timezone:
UTC Timezone:
Asia Timezone:

What you expected to happen: The timezone and timeline on the statusmap panel should change according to the change of the dashboard timezone.

How to reproduce (as minimally and accurately as possible): create a statusmap panel with RandomWalk datasource and change the dashboard timezone. Or import that dashboard into your grafana instance.

JSON:
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 10,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "cards": {
        "cardHSpacing": 2,
        "cardMinWidth": 5,
        "cardVSpacing": 2
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateGnYlRd",
        "defaultColor": "#757575",
        "exponent": 0.5,
        "mode": "spectrum",
        "thresholds": []
      },
      "datasource": {
        "type": "datasource",
        "uid": "grafana"
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "hideBranding": false,
      "highlightCards": true,
      "id": 4,
      "legend": {
        "show": true
      },
      "nullPointMode": "as empty",
      "pageSize": 15,
      "seriesFilterIndex": -1,
      "statusmap": {
        "ConfigVersion": "v1"
      },
      "title": "Panel Title",
      "tooltip": {
        "extraInfo": "",
        "freezeOnClick": true,
        "items": [],
        "show": true,
        "showExtraInfo": false,
        "showItems": false
      },
      "type": "flant-statusmap-panel",
      "useMax": true,
      "usingPagination": false,
      "xAxis": {
        "show": true
      },
      "yAxis": {
        "maxWidth": -1,
        "minWidth": -1,
        "show": true
      },
      "yAxisSort": "metrics",
      "yLabel": {
        "delimiter": "",
        "labelTemplate": "",
        "usingSplitLabel": false
      }
    },
    {
      "datasource": {
        "type": "datasource",
        "uid": "grafana"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 8
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "title": "Test1",
      "type": "timeseries"
    }
  ],
  "schemaVersion": 37,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "Asia/Dili",
  "title": "Test1",
  "uid": "coscpewoeij",
  "version": 2,
  "weekStart": ""
}

Problem detected by tests on different environments: Environment_1:

Environment_2:

Environment_3:

Environment_4:

headbreaker commented 11 months ago

Do we expect this to be fixed at some point?