Skip to content

Commit 957e178

Browse files
authored
Add postgres_exporter (#770)
1 parent b507173 commit 957e178

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

docker-compose/docker-compose.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,26 @@ services:
554554
restart: always
555555
stop_grace_period: 120s
556556

557+
# Description: This container will collect and expose prometheus metrics about `pgsql` PostgreSQL server.
558+
#
559+
# Disk: None
560+
# Ports exposed to other Sourcegraph services: 9187/TCP
561+
# Ports exposed to the public internet: none
562+
#
563+
# If you're using a DB instance hosted outside of docker-compose, the environment variables
564+
# for this container will need to be updated to reflect the new connection information.
565+
pgsql-exporter:
566+
container_name: pgsql-exporter
567+
image: 'index.docker.io/sourcegraph/postgres_exporter:3.37.0@sha256:20e58b62f064037ac3d901eba565f49d7e1daae2a237e6fa3d5351580d576dea'
568+
cpus: 0.1
569+
mem_limit: '50m'
570+
networks:
571+
- sourcegraph
572+
restart: always
573+
environment:
574+
- 'DATA_SOURCE_NAME=postgres://sg:@pgsql:5432/?sslmode=disable'
575+
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/queries.yaml'
576+
557577
# Description: PostgreSQL database for code intelligence data.
558578
#
559579
# Disk: 128GB / persistent SSD
@@ -579,6 +599,26 @@ services:
579599
restart: always
580600
stop_grace_period: 120s
581601

602+
# Description: This container will collect and expose prometheus metrics about `codeintel-db` PostgreSQL server.
603+
#
604+
# Disk: None
605+
# Ports exposed to other Sourcegraph services: 9187/TCP
606+
# Ports exposed to the public internet: none
607+
#
608+
# If you're using a DB instance hosted outside of docker-compose, the environment variables
609+
# for this container will need to be updated to reflect the new connection information.
610+
codeintel-db-exporter:
611+
container_name: codeintel-db-exporter
612+
image: 'index.docker.io/sourcegraph/postgres_exporter:3.37.0@sha256:20e58b62f064037ac3d901eba565f49d7e1daae2a237e6fa3d5351580d576dea'
613+
cpus: 0.1
614+
mem_limit: '50m'
615+
networks:
616+
- sourcegraph
617+
restart: always
618+
environment:
619+
- 'DATA_SOURCE_NAME=postgres://sg:@pgsql:5432/?sslmode=disable'
620+
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/code_intel_queries.yaml'
621+
582622
# Description: TimescaleDB time-series database for code insights data.
583623
#
584624
# Disk: 128GB / persistent SSD

prometheus/prometheus_targets.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
- labels:
4949
job: pgsql
5050
targets:
51-
- pgsql:9187
51+
- pgsql-exporter:9187
5252
- labels:
5353
job: codeintel-db
5454
targets:
55-
- codeintel-db:9187
55+
- codeintel-db-exporter:9187
5656
- labels:
5757
job: codeinsights-db
5858
targets:

0 commit comments

Comments
 (0)