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
fix: library panels not geting imported over dashboard API #43525
Conversation
Hi @efekete can you explain in more detail in what use case this fix is necessary? |
so the problem you solved (in above linked PR) was importing dashboard panels while importing the dashboard itself. It all works great when we are importing dashboard through UI. The problem we ran into was when we tried using a tool like https://github.com/netsage-project/gdg. |
Just so I understand, you're using the post dashboard api to import dashboards? There is an import dashboard api for that case. Not sure we'll consider this solution for this use case. |
Can you point me in right direction for that API? https://grafana.com/docs/grafana/latest/http_api/dashboard/ I think it would be good feature to import panels even when posting dashboard through dashboard API either way. |
You're absolutely correct and my vacation was too long it seems 🙈 The import endpoint doesn't seem to be documented at all, maybe this is more important. |
So what would be the best approach to mitigate this issue? |
Maybe someone from @grafana/backend-platform can chime in here? |
Also, if relevant, while trying to import dashboard that has panels that does not exist, I get an error: time="2022-01-10T21:10:09+01:00" level=info msg="error on Exporting dashboard Apps / Generic per pod HTTP error 500: returns Error while connecting library panels" One more reason I think this fix should probably be merged. Although, even when that happen I get dashboard imported, but not fully working. EDIT: error is from gdg, but only because Grafana returns 500 |
I am not 100% sure, but if I import the same dashboard through Grafana UI, it imports as expected with all library panels imported and linked. |
We don't support importing using the dashboard post api so we'll close this issue and PR. We can always revisit this if more feedback is received from the community. Thank you 🙏 |
So is there any officially supported API we can use for that? |
Not really. You have to figure out how to use non-documented |
I guess that is ok if you are not planing to remove that API in future. Should I, if I find time, try to write documentation for that or someone else is already working on that? |
We're currently not planning to remove it. Would that change in the future it will follow deprecation notice and breaking change in a major Grafana version. I'm not sure how easy it is to document it, but if you're interested you're welcome to give it a go. |
Hi @marefr I am having also issues when creating a regular dashboard when using panel libraries in the JSON https://community.grafana.com/t/issue-with-library-panels/60101 |
What this PR does / why we need it:
fix for library panels not getting imported over dashboard API
original feature for import/export of library panels (over Grafana UI) is here:
#39214
Fixes #
#44003
Special notes for your reviewer: