You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m developing a provider that allows describing Grafana dashboards using HCL.
For example:
# Define Grafana providerprovider"grafana" {
url="https://grafana.example.com/"auth=var.grafana_auth
}
# Create your dashboardresource"grafana_dashboard""my_dashboard" {
config_json=data.gdashboard_dashboard.dashboard.json# the JSON representation of the dashboard
}
data"gdashboard_dashboard""dashboard" {
title="My dashboard"layout {
section {
title="Basic Details"panel {
size={
height =8
width =10
}
source=data.gdashboard_stat.status.json
}
}
}
}
data"gdashboard_stat""status" {
title="Status"description="Shows the status of the container"field {
mappings {
value {
value="1"display_text="UP"color="green"
}
special {
match="null+nan"display_text="DOWN"color="red"
}
}
}
queries {
prometheus {
uid="prometheus"expr="up{container_name='container'}"instant=true
}
}
}
Unfortunately, the JSON output may become rather big when managing dashboards with many panels. As a result, the state file will grow, too. For example, 20+ dashboards with 20-30 panels each can easily occupy 20 MBs of the state file.
If the state file is stored in remote storage (e.g. S3), it takes 30-90 seconds only to download the file, which makes updates notably slow.
To keep the state file compact, I would like to keep the JSON representation gzipped and base64 encoded.
Would it be feasible to add a new config_json_base64_gzip (or any other suitable name) property to the dashboard resource? If so, I can work on the implementation.
The text was updated successfully, but these errors were encountered:
I'll close this one in favor of #1288. The goal is the same: reducing the amount of json that goes into the state. If something were to be implemented, it'd be a similar solution
Hello!
I’m developing a provider that allows describing Grafana dashboards using HCL.
For example:
Unfortunately, the JSON output may become rather big when managing dashboards with many panels. As a result, the state file will grow, too. For example, 20+ dashboards with 20-30 panels each can easily occupy 20 MBs of the state file.
If the state file is stored in remote storage (e.g. S3), it takes 30-90 seconds only to download the file, which makes updates notably slow.
To keep the state file compact, I would like to keep the JSON representation gzipped and base64 encoded.
Since
base64gunzip
does not exist in the terraform (Feature request: gunzip function · Issue #22568 · hashicorp/terraform · GitHub), the stored content needs to be decoded by the Grafana plugin.Would it be feasible to add a new
config_json_base64_gzip
(or any other suitable name) property to thedashboard
resource? If so, I can work on the implementation.The text was updated successfully, but these errors were encountered: