Skip to content

Commit e077c6e

Browse files
Add postgres datasource
1 parent 63d136d commit e077c6e

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

grafana/provisioning/datasources/datasource.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,20 @@ datasources:
1212
editable: true
1313
jsonData:
1414
timeInterval: 1s
15+
16+
- name: PostgreSQL
17+
type: postgres
18+
uid: postgres
19+
access: proxy
20+
orgId: 1
21+
url: postgres:5432
22+
database: ${POSTGRES_DB}
23+
user: ${POSTGRES_USER}
24+
secureJsonData:
25+
password: ${POSTGRES_PASSWORD}
26+
basicAuth: false
27+
isDefault: false
28+
editable: true
29+
jsonData:
30+
sslmode: disable
31+
postgresVersion: 1600

metrics-docker-compose.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ services:
1919
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
2020
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
2121
- GF_USERS_ALLOW_SIGN_UP=false
22+
# Postgres datasource
23+
- POSTGRES_HOST=postgres
24+
- POSTGRES_PORT=5432
25+
- POSTGRES_DB=postgres
26+
- POSTGRES_USER=postgres
27+
- POSTGRES_PASSWORD=postgres
2228
restart: unless-stopped
2329
ports:
2430
- "3000:3000"

0 commit comments

Comments
 (0)