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

Grafana Folder werden nicht wiederhergestellt #1192

Open
Marc-Berg opened this issue Dec 14, 2024 · 8 comments
Open

Grafana Folder werden nicht wiederhergestellt #1192

Marc-Berg opened this issue Dec 14, 2024 · 8 comments

Comments

@Marc-Berg
Copy link
Contributor

Marc-Berg commented Dec 14, 2024

Describe the bug
In Grafana angelegte Folder werden nicht wiederhergestellt und als leere Dashboard-Objekte erstellt

To Reproduce

  1. Erstellen einer einfachen Struktur aus einem Folder (f1) und einem Dashboard (d1)
    grafik

  2. Backup durch Backitup

[DEBUG] [grafana] Grafana is available ... Status: 200
[DEBUG] [grafana] found Dashboard: f1
[DEBUG] [grafana] found Dashboard: d2
[DEBUG] [grafana] start Grafana backup compress ...
[DEBUG] [grafana] Backup created: /opt/iobroker/backups/grafana_2024_12_14-12_18_54_backupiobroker.tar.gz

grafana_2024_12_14-12_18_54_backupiobroker.tar.gz

(es wird keine Unterscheidung zwischen Folders und Dashboards gemacht)

  1. Wiederherstellen auf einem leeren Grafana
12:23:22.914 DEBUG grafana Try to Restore: /opt/iobroker/backups/grafana_tmp/dashboards/d2.json
12:23:22.935 DEBUG grafana dashboard restore for "f1" finish: {"folderUid":"","id":18,"slug":"f1","status":"success","uid":"be6qfaupomo74e","url":"/d/be6qfaupomo74e/f1","version":1}
12:23:22.963 DEBUG grafana dashboard restore for "d2" finish: {"folderUid":"","id":19,"slug":"d2","status":"success","uid":"fe6vxpw25o2kga","url":"/d/fe6vxpw25o2kga/d2","version":1}
  1. Die vorherige Struktur wird nicht wiederhergetellt, stattdessen wird aus dem Folder-Objekt ein Dashboard-Objekt gemacht

grafik

Expected behavior
Aufbau der alten Struktur aus Folders und Dashboards

Versions:

  • Adapter version: 3.0.31
  • JS-Controller version: 7.0.6
  • Node version: 20.18.1
  • Operating system: Buanet Docker
Copy link

Thanks for reporting a new issue @Marc-Berg!

  1. Please make sure your topic is not covered in the German documentation or English documentation
  2. Please attach all necessary log files (in debug mode!), screenshots and other information to reproduce this issue
  3. Search for the issue topic in other/closed issues to avoid duplicates!

Otherwise this issue will be closed.

@simatec
Copy link
Owner

simatec commented Dec 14, 2024

Kannst du mal die Inhalte des Backups posten. Auch die Inhalte der json Files

@Marc-Berg
Copy link
Contributor Author

Marc-Berg commented Dec 14, 2024

Kannst du mal die Inhalte des Backups posten. Auch die Inhalte der json Files

Ich hatte das Backupfile angehängt. Ist das ausreichend?

@simatec
Copy link
Owner

simatec commented Dec 16, 2024

Kannst du bitte mal weitere Test machen?

  1. einen Ordner mit dem Namen A1 anlegen
  2. ein Dashboard mit dem Namen d1 in den Ordner A1 legen
  3. Backup erstellen und hier posten

@Marc-Berg
Copy link
Contributor Author

@simatec
Copy link
Owner

simatec commented Dec 29, 2024

Ist ein sehr komisches Verhalten, was sich hier abspielt. In der json wird nirgendwo erfasst, in welchen Folder das Dashboards liegt. Kannst du mir mal die reine json des Dashboards und des Folders aus Grafana zeigen?

@Marc-Berg
Copy link
Contributor Author

Hier das JSON des Dashboards, für den Folder lässt sich kein JSON erstellen:

{
  "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": 21,
  "links": [
    {
      "asDropdown": true,
      "icon": "external link",
      "includeVars": false,
      "keepTime": true,
      "tags": [],
      "targetBlank": false,
      "title": "New link",
      "tooltip": "",
      "type": "dashboards",
      "url": ""
    },
    {
      "asDropdown": false,
      "icon": "external link",
      "includeVars": false,
      "keepTime": false,
      "tags": [],
      "targetBlank": false,
      "title": "New link",
      "tooltip": "",
      "type": "dashboards",
      "url": ""
    }
  ],
  "panels": [
    {
      "datasource": {
        "type": "grafana",
        "uid": "grafana"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "barWidthFactor": 0.6,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": 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": 8,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "11.4.0",
      "targets": [
        {
          "datasource": {
            "type": "datasource",
            "uid": "grafana"
          },
          "refId": "A"
        }
      ],
      "title": "Panel Title",
      "type": "timeseries"
    }
  ],
  "preload": false,
  "refresh": "",
  "schemaVersion": 40,
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "d1",
  "uid": "be75x0quu2lmod",
  "version": 4,
  "weekStart": ""
}

Über die search API ließe sich allerdings die Struktur rekonstruieren:

grafik

[
  {
    "id": 20,
    "uid": "fe75wzi95cbuoc",
    "title": "A1",
    "uri": "db/a1",
    "url": "/dashboards/f/fe75wzi95cbuoc/a1",
    "slug": "",
    "type": "dash-folder",
    "tags": [],
    "isStarred": false,
    "sortMeta": 0,
    "isDeleted": false
  },
  {
    "id": 21,
    "uid": "be75x0quu2lmod",
    "title": "d1",
    "uri": "db/d1",
    "url": "/d/be75x0quu2lmod/d1",
    "slug": "",
    "type": "dash-db",
    "tags": [],
    "isStarred": false,
    "folderId": 20,
    "folderUid": "fe75wzi95cbuoc",
    "folderTitle": "A1",
    "folderUrl": "/dashboards/f/fe75wzi95cbuoc/A1",
    "sortMeta": 0,
    "isDeleted": false
  }
]

@simatec
Copy link
Owner

simatec commented Dec 30, 2024

Gut dann muss ich mal schauen, ob die API auch Folder wiederherstellen kann und auch sichern kann

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

No branches or pull requests

2 participants