Skip to content

Commit

Permalink
🚧 (cdviz-grafana) update setup
Browse files Browse the repository at this point in the history
  • Loading branch information
davidB committed Mar 31, 2024
1 parent cc1da6c commit 33dcfe1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
13 changes: 6 additions & 7 deletions cdviz-grafana/dashboards/cdevents-activity.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "postgres",
"uid": "P3ABDE63318046581"
"type": "grafana-postgresql-datasource",
"uid": "cdviz-db"
},
"gridPos": {
"h": 8,
Expand All @@ -49,13 +48,13 @@
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "P3ABDE63318046581"
"type": "grafana-postgresql-datasource",
"uid": "cdviz-db"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT \"timestamp\",\n \"payload\"\nFROM \"cdevents_lake\"\nWHERE $__timeFilter(timestamp) \nORDER BY \"timestamp\" DESC",
"rawSql": "SELECT \"timestamp\",\n \"subject\",\n \"predicate\",\n \"payload\"\nFROM \"cdevents_lake\"\nWHERE $__timeFilter(timestamp) \nORDER BY \"timestamp\" DESC",
"refId": "A",
"sql": {
"columns": [
Expand All @@ -81,7 +80,7 @@
}
],
"refresh": "",
"schemaVersion": 38,
"schemaVersion": 39,
"tags": [],
"templating": {
"list": []
Expand Down
22 changes: 22 additions & 0 deletions cdviz-grafana/datasources/cdviz-db.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: 1

datasources:
- name: cdviz-db
uid: cdviz-db
type: grafana-postgresql-datasource
access: proxy
url: "$CDVIZ_RO_POSTGRES_HOST:$CDVIZ_RO_POSTGRES_PORT_NUMBER"
user: $CDVIZ_RO_POSTGRES_USER
secureJsonData:
password: $CDVIZ_RO_POSTGRES_PASSWORD
jsonData:
database: $CDVIZ_RO_POSTGRES_DB
sslmode: 'disable' # disable/require/verify-ca/verify-full
maxOpenConns: 100 # Grafana v5.4+
maxIdleConns: 100 # Grafana v5.4+
maxIdleConnsAuto: true # Grafana v9.5.1+
connMaxLifetime: 14400 # Grafana v5.4+
postgresVersion: 1500 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10
timescaledb: false
# - name: TestData
# type: testdata
4 changes: 2 additions & 2 deletions charts/cdviz/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ data:
POSTGRES_PASSWORD: |-
{{ .Values.secrets.values.CDVIZ_RO_POSTGRES_PASSWORD | b64enc }}
POSTGRES_HOST: |-
{{ .Values.secrets.values.POSTGRES_HOST | b64enc }}
{{ .Values.secrets.values.CDVIZ_RO_POSTGRES_HOST | default .Values.secrets.values.POSTGRES_HOST | b64enc }}
POSTGRES_PORT_NUMBER: |-
{{ .Values.secrets.values.POSTGRES_PORT_NUMBER | b64enc }}
{{ .Values.secrets.values.CDVIZ_RO_POSTGRES_PORT_NUMBER | default .Values.secrets.values.POSTGRES_PORT_NUMBER | b64enc }}
POSTGRES_DB: |-
{{ .Values.secrets.values.POSTGRES_DB | b64enc }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/cdviz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ secrets:
# RO (read-only) used by cdviz-grafana to query data from the db
CDVIZ_RO_POSTGRES_USER: cdviz-ro
CDVIZ_RO_POSTGRES_PASSWORD: postgres-password
# CDVIZ_RO_POSTGRES_HOST: cdviz-postgresql # to override if different from POSTGRES_HOST
# CDVIZ_RO_POSTGRES_PORT_NUMBER: "5432" # to override if different from POSTGRES_HOST

cdviz-collector:
enabled: true
Expand Down

0 comments on commit 33dcfe1

Please sign in to comment.