Skip to content

Commit

Permalink
Grafana Terraform examples (#61)
Browse files Browse the repository at this point in the history
Terraform dashboard example of configuring a ServiceNow Cloud Observability Datasource
  • Loading branch information
heidmotron authored Oct 10, 2024
1 parent 138ff49 commit e8aec09
Show file tree
Hide file tree
Showing 5 changed files with 531 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ e2e-results/
# generated plugin
dist/
releases/

# terraform
.terraform*
terraform.*
*.tfvars
21 changes: 21 additions & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Terraform Grafana Example

This is an example of how you can use Terraform to create:

- A Service Cloud Observability datasource
- A dashboard with template variables and spans and logs panels


To run:

```
terraform apply -var-file=vars.tfvars
```

Where the `vars.tfvars` specifies Grafana service account token and Cloud Observability API token:

```
grafana_auth = "<service-account-token>"
grafaha_host = "https://<grafana-host>"
lighstep_api_key = "<cloud-observability-api-token>"
```
15 changes: 15 additions & 0 deletions terraform/datasource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "grafana_data_source" "demo" {
type = "servicenow-cloudobservability-datasource"
name = "demo"
uid = "snco-demo-ds-test-uid"
url = "https://${var.lightstep_api_host}"
json_data_encoded = jsonencode({
orgName = "LightStep"
projectName = "demo"
apiHost = var.lightstep_api_host
})

secure_json_data_encoded = jsonencode({
apiKey = var.lighstep_api_key
})
}
Loading

0 comments on commit e8aec09

Please sign in to comment.