[BUG] Grafana dashboard in priv folder fails to load
Closed this issue · 1 comments
briankariuki commented
Describe the bug
I've added a dashboard.json in a folder in priv priv/grafana/dashboard.json
. I then added it to the dashboards section in the generated file like so
It works in dev, but when deployed in a docker container I get this error. I've also checked in the docker container and the dashboard.json file exists at that path.
[warning] Received a 404 from Grafana because: %Finch.Response{status: 404, body: "{\"message\":\"Dashboard not found\",\"status\":\"not-found\"}", headers: [{"cache-control", "no-store"}, {"content-type", "application/json"}, {"x-content-type-options", "nosniff"}, {"x-frame-options", "deny"}, {"x-xss-protection", "1; mode=block"}, {"date", "Sun, 31 Mar 2024 19:35:01 GMT"}, {"content-length", "54"}], trailers: []}
PromEx.DashboardUploader failed to upload /app/lib/shield-0.1.0/priv/grafana/dashboard.json to Grafana: :not_found
To Reproduce
Steps to reproduce the behavior:
- Add the following plugins to PromEx
- Start my sample application
- Create folder inside priv named grafana. Add dashboard json inside this folder.
- Reference the json file in the dashboard's section in the file generated by promex plugin
- Build docker container.
Expected behavior
I expect that it would work the same as it does on dev, that is upload the dashboard defined in the json file to grafana.
Environment
- Elixir version: 1.16.2
- Erlang/OTP version: 26
- Grafana version: latest
- Prometheus version: latest
briankariuki commented
Closing this. I realized I have to set the id field in the dashboard.json to null for it to work.