terraform-provider-newrelic
terraform-provider-newrelic copied to clipboard
Incompatibility of `jsonencode()` with `one_dashboard_raw` widgets
Summary
It appears that the newly-introduced one_dashboard_raw
is incompatible with chart widgets composed with jsonencode()
.
Expected Behaviour
Since one_dashboard_raw
requires JSON within its configuration field, I expected this to accept jsonencode()
input as below.
widget {
~
visualization_id = "viz.line"
configuration = jsonencode({
nrqlQueries = {
accountId = 2172084
query = "FROM Transaction SELECT count(duration) FACET appName TIMESERIES"
}
})
}
This should be formatted correctly, as confirmed on hcl2json. However, the following error is returned instead.
Error: maximum retries reached: An unexpected error has occurred, A downstream error occurred.,
[{"extensions":{},"message":"An unexpected error has occurred"}]
Actual Behaviour
The above snippet's explicit JSON variant works just fine.
widget {
~
visualization_id = "viz.line"
configuration = <<-EOT
{
"nrqlQueries": [
{
"accountId": 2172084,
"query": "FROM Transaction SELECT count(duration) FACET appName TIMESERIES"
}
]
}
EOT
}
References
#1211 and #1308 with regards to the consolidation of dashboards widgets being refactored to use rawConfiguration
.
Environment
- Terraform: v1.0.3
- Provider: v2.24.1
- OS: Windows 10 Pro
Thanks for your time.
Context
In order to confirm whether jsonencode()
works at all, here's a working example of a Markdown widget.
widget {
~
visualization_id = "viz.markdown"
configuration = jsonencode({
text = "Text content"
})
}
To expand on one_dashboard_raw
, is there support yet for filtering on facets via linked entities guid or some other way?
EDIT: Logged separately in #1413.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs.
This issue has been automatically closed due to a lack of activity for an extended period of time.
#1308 related issue one_dashboard_raw
Really promising to see this and #1413 being added to the New dashboard resource milestone.
Just FYI we've recently add support for JSON dashboards: https://github.com/newrelic/terraform-provider-newrelic/discussions/2044
Hey @kidk, that's pretty good-going and more or less deprecates this issue altogether. Thanks for the update!