After successfully installing and importing Grafana dashboards in an Azure Kubernetes Service using Pulumi through a HelmRelease Custom Resource Definition of the kube-prometheus-stack
, I have been able to configure ConfigMaps
to import dashboards stored as JSON files.
Now, my goal is to organize these imported dashboards into custom folders within Grafana.
I am facing two main challenges: creating folders (first problem) and specifying the folder for each imported dashboard.
For example, here is how I currently import a dashboard (which ends up in the root folder in Grafana):
const myDashboard = fs.readFileSync(
'dashboards/myDashboard.json',
'utf-8'
);
new k8s.core.v1.ConfigMap(
'my-dashboard-cm',
{
metadata: {
name: 'my-dashboard',
namespace: args.namespace,
labels: { grafana_dashboard: '1' },
},
data: { 'my-dashboard.json': JSON.stringify(JSON.parse(myDashboard)) },
},
{ parent: this }
);
Any assistance on how to create custom folders and assign imported dashboards to them would be greatly appreciated!