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

AWS cost attribution (2c/4): convert Grafana dashboard into a .jsonnet template and version control it #4875

Closed
3 tasks
Tracked by #4872
consideRatio opened this issue Sep 24, 2024 · 4 comments · Fixed by #4934
Closed
3 tasks
Tracked by #4872
Assignees

Comments

@consideRatio
Copy link
Member

consideRatio commented Sep 24, 2024

The naming 2x/n is meant to indicate it can be worked in parallell amongside other 2x/n issues

The cost attribution dashboard central source of truth is currently in https://grafana.openscapes.2i2c.cloud where Grafana has it written to a small disk after being developed in the UI. But, we need to deploy it to more places and keep those places updated. So, how do we do that?

Technical context

The https://github.com/jupyterhub/grafana-dashboards project version controlls a few dashboards in .jsonnet format. They are rendered into the Grafana JSON format using the go-jsonnet's jsonnet CLI using the GoLang graffonet library.

Its nicer to work with a dashboard in a .jsonnet format than the big JSON blob it is by default, but its a bit of work to convert the Grafana JSON blob to its equivalent in .jsonnet.

Dashboard ID issue

Currently the documented procedure to deploy the dashboard involves updating a dashboard ID. I think maybe that can be avoided by introducing a dashboard variable that gets autopopulated, and then we reference the variable. I think this is how the jupyterhub/grafana-dashboard function currently with the prometheus datasource - they reference a datasource variable.

Definition of done

  • The current openscapes dashboard JSON blob is converted to a .jsonnet dashboard file
  • The converted .jsonnet dashboard is verified to look and behave alike the original by deploying it using the deploy.py script from jupyterhub/grafana-dashboards
    Use flags like --dashboards-dir=<a folder where we have the .jsonnet file>, --folder-name=<Some grafana folder name>, --folder-uid=aws-ce-grafana-backend
  • The developed .jsonnet file is version controlled somewhere
    Its fine and perhaps suitable to initially do it in this repository.
@consideRatio consideRatio changed the title AWS cost attribution (3a/n): start version control the grafana dashboard definitions AWS cost attribution (3b/n): start version control the grafana dashboard definitions Sep 24, 2024
@consideRatio consideRatio changed the title AWS cost attribution (3b/n): start version control the grafana dashboard definitions AWS cost attribution (3b/n): convert Grafana dashboard into a .jsonnet template and version control it Sep 25, 2024
@consideRatio consideRatio changed the title AWS cost attribution (3b/n): convert Grafana dashboard into a .jsonnet template and version control it AWS cost attribution (2c/n): convert Grafana dashboard into a .jsonnet template and version control it Sep 25, 2024
@consideRatio consideRatio changed the title AWS cost attribution (2c/n): convert Grafana dashboard into a .jsonnet template and version control it AWS cost attribution (2c/4): convert Grafana dashboard into a .jsonnet template and version control it Sep 25, 2024
@GeorgianaElena GeorgianaElena self-assigned this Oct 3, 2024
@GeorgianaElena
Copy link
Member

@consideRatio, I am correct to think that the intention is for the jssonet to live in juptyerhub/grafana-dashboards, right?

@consideRatio
Copy link
Member Author

@GeorgianaElena no as that project is part of the jupyterhub org, and its inclusion there means also aws-ce-grafana-backend needs go be available and open sourced properly.

Let this be entirely 2i2c specific for now, but do make use of the jupyterhub/grafana-dashboard's deploy script to render and deploy the dashboard.

@consideRatio
Copy link
Member Author

Should we go for a timeboxed 15 min chat to get started, with the goal to have an empty dummy dashboard to deploy?

@GeorgianaElena
Copy link
Member

The definition of done was respected for the first 3 panels. The reaming depend on the existence of a variable that I could not figure out and I've opened to track this work #4944.

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

Successfully merging a pull request may close this issue.

2 participants