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

Dashboard extraction failures do not result in a failure (non-zero) exit code #35

Closed
bjhartin opened this issue Jan 5, 2022 · 7 comments

Comments

@bjhartin
Copy link
Contributor

bjhartin commented Jan 5, 2022

When I run:

grafana-sync pull-dashboards --apikey=GRAFANA_API_KEY --directory=dashboards --url=GRAFANA_URL

Some dashboards cannot be retrieved (for which I may raise another issue). See:

2022/01/05 09:49:16 unmarshal board: json: cannot unmarshal object into Go struct field Board.panels of type string for db/dashboard1

The exit code is still 0, however. I had build an automated job to backup the dashboards and it has been 'green' despite these failures because the exit code from grafana-sync was 0. Can this be changed?

@mpostument
Copy link
Owner

Thank you for submitting the issue. I will try to fix this in the next few days

@bjhartin
Copy link
Contributor Author

bjhartin commented Jan 21, 2022

Is there a way to get more info about why these can't sync? Over the last week or two, grafana-sync has produced more of these errors and now most of my dashboards aren't syncing. Is this a matter of a panel that has attributes the code doesn't expect?

@mpostument
Copy link
Owner

There is issue opened for grafana sdk. But it is not resolved now
grafana-tools/sdk#130

@mpostument
Copy link
Owner

Maybe this would solve it - grafana-tools/sdk#130

@bjhartin
Copy link
Contributor Author

@mpostument I'm curious - if the goal is to extract the json for backup/restore, why even map it to any data structure other than 'json'/'string'?

For now I've switched to CURLing the API to avoid mapping errors.

@mpostument
Copy link
Owner

@bjhartin I don't have an answer for that, this is how SDK is working.

@mpostument
Copy link
Owner

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