Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Working with Library Panels - missing details #281

Closed
techuser12345 opened this issue Aug 15, 2024 · 2 comments
Closed

Working with Library Panels - missing details #281

techuser12345 opened this issue Aug 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@techuser12345
Copy link

Describe the bug
I use GDG to export the dashboard and push dashboard .json files to stash under: grafana/dashboards/folders/.json
I put those *.json files in prod as grafana provisioning. I also have datasource.yml
I notice "Panel plugin not found: Unable to load library panel: XXXXXX-XXXXXX-XXXXX" error in prod.

I went through this document https://software.es.net/gdg/docs/tutorials/working-with-library-panels/
You have listed rules. But the solution is not clear.
Are you suggesting this is the workaround/solution we should use 'The only way I can see to move a lib element is to unlink the panel, delete the panel and re-create it in a different folder, then re-link it.'
If so the steps mentioned below or the order do not match the statement.

I would like to know how to make library panel work in prod environment using provisioning and gdg is there a way where we can make it available please?

To Reproduce
Steps to reproduce the behavior:

  1. in Grafana UAT GUI create dashboards, library panel.
  2. Run GDG to export dashboards to stash
  3. set up grafana provisioning so the dashboards are put in a path so grafana provisioning can pick up
  4. load a dashboard with library panel you will see error ""Panel plugin not found: Unable to load library panel: XXXXXX-XXXXXX-XXXXX" "
  5. UAT will not have error as the library panels were created in Grafana UAT GUI.

Expected behavior
Step-by-step instruction how to export library panels from UAT and make them available in prod - achievable via automation (bash script) not manual GUI steps ,as there will be several library panels linked to different dashboards (one to many relationships).

Desktop (please complete the following information):

  • GDG Version: 0.4.1
  • Grafana Version: v9.5.2
  • Configuration for Importer

Additional context

@techuser12345 techuser12345 added the bug Something isn't working label Aug 15, 2024
@safaci2000
Copy link
Contributor

Library panels are just weird in Grafana. I went down the rabbit hole when I was working on the feature, but let me see if I can remember.

The main thing is that you can't import a dashboard into Grafana prior to the library component existing. So once you have a library components in your staging ENV, you pull it down, pull the associated dashboards and then export them out to production.

You just can't upload a dashboard while the library component doesn't exist, and you can't delete a library component while a dashboard references it.

I have a test for that, so my first step is:

gdg b libraryelements upload 

out:

2024-08-15 18:43:33 INF Reading files from folder folder=test/data/org_main-org/libraryelements
┌────────────────────────────────────────────────────────────────┐
│ NAME                                                           │
├────────────────────────────────────────────────────────────────┤
│ Dashboard Makeover - Extra Cleaning Duty Assignment Today      │
│ Dashboard Makeover - Lighting Status                           │
│ Dashboard Makeover - Side Dish Prep Times, past 7 days         │
│ Dashboard Makeover - Time since we purchased these spices      │
│ Extreme Dashboard Makeover - Grill                             │
│ Extreme Dashboard Makeover - Mac Oven                          │
│ Extreme Dashboard Makeover - Refrigerator Temperature (F)      │
│ Extreme Dashboard Makeover - Room Temperature (F)              │
│ Extreme Dashboard Makeover - Salmon Cooking Times, past 7 days │
└────────────────────────────────────────────────────────────────┘

Then you can List the dashboards that have a connection with the given panel ID: (Latest release has a bug with this though I can push a small patch soon ).

./bin/gdg b libraryelements list-connections T47RSwQnz

The T47...etc is the library panel ID.

2024-08-15 18:52:09 INF Running Sanity Check of Organization Membership
2024-08-15 18:52:09 INF Listing library connections for context context=testing
┌────┬───────────┬──────────────────────────────┬──────────────────────────────┬────────┐
│ ID │ UID       │ SLUG                         │ TITLE                        │ FOLDER │
├────┼───────────┼──────────────────────────────┼──────────────────────────────┼────────┤
│ 12 │ F3eInwQ7z │ dashboard-makeover-challenge │ Dashboard Makeover Challenge │ Other  │
└────┴───────────┴──────────────────────────────┴──────────────────────────────┴────────┘

If you look at the JSON for the dashboard you'll see that the UID for the libarary panel matches:

      "libraryPanel": {
        "description": "",
        "meta": {
          "connectedDashboards": 3,
          "created": "2022-04-27T21:27:23Z",
          "createdBy": {
            "avatarUrl": "/avatar/579fc54abdc9ab34fb4865322f2870a1",
            "id": 13,
            "name": "[email protected]"
          },
          "folderName": "mj",
          "folderUid": "R0bMCcW7z",
          "updated": "2022-04-27T21:29:50Z",
          "updatedBy": {
            "avatarUrl": "/avatar/579fc54abdc9ab34fb4865322f2870a1",
            "id": 13,
            "name": "[email protected]"
          }
        },
        "name": "Dashboard Makeover - Extra Cleaning Duty Assignment Today",
        "type": "table",
        "uid": "T47RSwQnz",
        "version": 2
      },

To create this in production, you just need to.

  1. Upload Library panels to your production instance and upload your dashboards. The IDs have to match but otherwise this should be pretty seamless.

@safaci2000
Copy link
Contributor

safaci2000 commented Aug 15, 2024

#283 Fixes the listing issue.

@safaci2000 safaci2000 changed the title [BUG] Working with Library Panels - missing details Working with Library Panels - missing details Aug 20, 2024
@esnet esnet locked and limited conversation to collaborators Aug 20, 2024
@safaci2000 safaci2000 converted this issue into discussion #286 Aug 20, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants