Skip to content

Commit d7da7bf

Browse files
authored
chore: new grafana datasouce (#24904)
Fix A-1410
2 parents d288249 + 01e9d85 commit d7da7bf

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

spartan/metrics/values/prod.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,16 @@ grafana:
166166
- name: Tempo
167167
type: tempo
168168
url: http://metrics-tempo.metrics:3100
169+
- name: propose-watcher
170+
uid: propose-watcher-pg
171+
type: postgres
172+
access: proxy
173+
url: $PROPOSE_WATCHER_PG_HOST
174+
user: $PROPOSE_WATCHER_PG_USER
175+
jsonData:
176+
database: $PROPOSE_WATCHER_PG_DATABASE
177+
sslmode: disable
178+
postgresVersion: 1600
179+
maxOpenConns: 4
180+
secureJsonData:
181+
password: $PROPOSE_WATCHER_PG_PASSWORD

spartan/terraform/deploy-metrics/main.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ resource "helm_release" "aztec-gke-cluster" {
163163
{
164164
name = "grafana-webhooks"
165165
optional = false
166+
},
167+
{
168+
name = "grafana-propose-watcher-datasource"
169+
optional = false
166170
}
167171
]
168172

@@ -205,6 +209,26 @@ resource "helm_release" "aztec-gke-cluster" {
205209
{ secretKey = "SLACK_WEBHOOK_MAINNET_URL", remoteRef = { key = var.SLACK_WEBHOOK_MAINNET_SECRET_NAME } },
206210
]
207211
}
212+
},
213+
{
214+
apiVersion = "external-secrets.io/v1"
215+
kind = "ExternalSecret"
216+
metadata = {
217+
name = "grafana-propose-watcher-datasource"
218+
}
219+
spec = {
220+
refreshInterval = "1m"
221+
secretStoreRef = {
222+
name = "gcp-secret-store"
223+
kind = "ClusterSecretStore"
224+
}
225+
data = [
226+
{ secretKey = "PROPOSE_WATCHER_PG_HOST", remoteRef = { key = var.PROPOSE_WATCHER_GRAFANA_DATASOURCE_SECRET_NAME, property = "host" } },
227+
{ secretKey = "PROPOSE_WATCHER_PG_DATABASE", remoteRef = { key = var.PROPOSE_WATCHER_GRAFANA_DATASOURCE_SECRET_NAME, property = "database" } },
228+
{ secretKey = "PROPOSE_WATCHER_PG_USER", remoteRef = { key = var.PROPOSE_WATCHER_GRAFANA_DATASOURCE_SECRET_NAME, property = "user" } },
229+
{ secretKey = "PROPOSE_WATCHER_PG_PASSWORD", remoteRef = { key = var.PROPOSE_WATCHER_GRAFANA_DATASOURCE_SECRET_NAME, property = "password" } },
230+
]
231+
}
208232
}
209233
]
210234
}

spartan/terraform/deploy-metrics/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ variable "GRAFANA_PASSWORD_SECRET_NAME" {
2222
default = "grafana-dashboard-password"
2323
}
2424

25+
variable "PROPOSE_WATCHER_GRAFANA_DATASOURCE_SECRET_NAME" {
26+
description = "GCP Secret Manager JSON secret containing the propose-watcher Grafana datasource connection values"
27+
type = string
28+
default = "propose-watcher-grafana-datasource"
29+
}
30+
2531
variable "SLACK_WEBHOOK_SECRET_NAME" {
2632
description = "Webhook to use to send to notifications"
2733
type = string

0 commit comments

Comments
 (0)