Using Terraform to generate New Relic dashboards from NRQL queries
Blog post from New Relic
In this blog, James Buchanan, a Principal Solutions Architect at New Relic, explains how to use Terraform and NRQL (New Relic Query Language) to create dynamic dashboards in New Relic based on live data. This installment, part three of a series, details how to leverage a Terraform provider to query the New Relic GraphQL API and generate a dashboard that reflects the top five most popular APIs over the past 24 hours, without modifying the existing Terraform configuration. The process involves defining a GraphQL query, configuring the GraphQL provider with an API key, and utilizing the `jsondecode` function to extract necessary data from NRQL query results, which are then used in a template file to dynamically create dashboard rows. This approach allows for creating dashboards that adapt to changing data, such as top-performing apps or overloaded servers, and recommends maintaining these configurations through a CI/CD workflow for ongoing updates. The blog encourages readers to explore the accompanying code repository for practical examples and highlights the value of integrating Terraform with New Relic to enhance observability through customizable dashboards.