Add the Grafana Terraform provider to your providers block: source = grafana/grafana, and configure it with the url and auth (YOUR_TOKEN) attributes
Define a grafana_folder resource for your service dashboards to keep them organized
Write a grafana_dashboard resource with a json_encoded_dashboard argument pointing to a local JSON file or using the jsonencode() function inline; include three panels: Rate (requests/sec using rate()), Errors (error ratio), and Duration (histogram_quantile over your latency histogram)
Parameterize the dashboard with template variables for service name and environment using the templating.list array in the dashboard JSON so the same dashboard works across services
Run terraform plan to preview the dashboard diff and terraform apply to create it; use the grafana_dashboard.dashboard_url output to link to the created dashboard
Store the Terraform state in a remote backend (S3 or Terraform Cloud) and add a CI job that runs terraform fmt and terraform validate on every pull request
Known gotchas
The Grafana provider's grafana_dashboard resource replaces the dashboard on every apply if the JSON changes; use lifecycle { ignore_changes } with caution as it may prevent legitimate updates from being applied
Panel IDs within the dashboard JSON must be unique integers; if you compose JSON from multiple modules that each start IDs at 1, conflicts will cause panels to overwrite each other silently
Grafana API tokens used in the provider auth attribute must have Editor or Admin role to create dashboards; Viewer tokens will return 403 errors with no further explanation
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp