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

Fail to run mimirtool analyze grafana, with error unmarshal board: json #1840

Closed
jovezhong opened this issue May 10, 2022 · 5 comments · Fixed by #1973
Closed

Fail to run mimirtool analyze grafana, with error unmarshal board: json #1840

jovezhong opened this issue May 10, 2022 · 5 comments · Fixed by #1973
Labels
bug Something isn't working component/mimirtool

Comments

@jovezhong
Copy link

Describe the bug

A clear and concise description of what the bug is.

I was trying to follow https://grafana.com/docs/grafana-cloud/metrics-control-usage/control-prometheus-metrics-usage/usage-analysis-mimirtool/ to reduce the unused metrics

However when I downloaded the CLI on my Mac and ran it
./mimirtool-darwin-amd64 analyze grafana --address=https://a.grafana.net --key=eyJrIjoiN..

I got errors

unmarshal board: json: cannot unmarshal object into Go struct field Board.panels of type string for ..
unmarshal board: json: cannot unmarshal object into Go struct field Board.panels of type string for RwmMppyP3 Docker
unmarshal board: json: cannot unmarshal object into Go struct field Board.panels of type string for ..
unmarshal board: json: cannot unmarshal object into Go struct field Board.panels of type string for BJoCSSY7k Node Exporter / Nodes

To Reproduce

Grafana Cloud

mimirtool-darwin-amd64

@pracucci
Copy link
Collaborator

Could you share the dashboard JSON in a gist, making sure it doesn't contain any sensitive data, please? I would like to reproduce it.

@pracucci pracucci added component/mimirtool bug Something isn't working labels May 13, 2022
@biandopa
Copy link

I'm having the same problem and some of my dashboards are empty

@ranjitburgute
Copy link

ranjitburgute commented May 29, 2022

I am also facing the same issue while trying to filter out metrics used in nginx.json to configure metrics allowlist.

nginx dashboard file: https://github.com/kubernetes/ingress-nginx/blob/main/deploy/grafana/dashboards/nginx.json
tested with mimirtool v2.1.0
command: mimirtool analyze dashboard nginx.json
error: json: cannot unmarshal object into Go struct field Board.panels of type string for nginx.json

@gmintoco
Copy link
Contributor

I am getting the same error with the MySQL mixin (and a whole bunch of other dashboards that we made internally): https://github.com/prometheus/mysqld_exporter/blob/main/mysqld-mixin/dashboards/mysql-overview.json

Running Grafana v8.5.3 (409e9bc9a5) and trying to incorporate mimirtool analyse into our CI pipelines to automatically adjust the amount of metrics pushed based on dashboards

@hjet
Copy link
Contributor

hjet commented Jun 1, 2022

Closing this issue tentatively as #1973 should fix this.

Please open a new issue and attach a sample dashboard failure case if you encounter any further errors.

@gmintoco and @ranjitburgute I tested the fix on your provided dashboards, thanks for providing those!

Note that until the next release gets cut, you will have to build mimirtool yourself:

go build ./cmd/mimirtool

@hjet hjet closed this as completed Jun 1, 2022
@hjet hjet linked a pull request Jun 1, 2022 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/mimirtool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants