@@ -48,6 +48,8 @@ services:
4848 depends_on :
4949 pgsql :
5050 condition : service_healthy
51+ codeinsights-db :
52+ condition : service_healthy
5153 codeintel-db :
5254 condition : service_healthy
5355
@@ -568,7 +570,7 @@ services:
568570 # for this container will need to be updated to reflect the new connection information.
569571 pgsql-exporter :
570572 container_name : pgsql-exporter
571- image : ' index.docker.io/sourcegraph/postgres_exporter:3.37.0 @sha256:20e58b62f064037ac3d901eba565f49d7e1daae2a237e6fa3d5351580d576dea '
573+ image : ' index.docker.io/sourcegraph/postgres_exporter:insiders @sha256:f626c611ea5f4bb9efe184994755dfb64d117d4f50c74fc09665093bf1e6939e '
572574 cpus : 0.1
573575 mem_limit : ' 50m'
574576 networks :
@@ -615,7 +617,7 @@ services:
615617 # for this container will need to be updated to reflect the new connection information.
616618 codeintel-db-exporter :
617619 container_name : codeintel-db-exporter
618- image : ' index.docker.io/sourcegraph/postgres_exporter:3.37.0 @sha256:20e58b62f064037ac3d901eba565f49d7e1daae2a237e6fa3d5351580d576dea '
620+ image : ' index.docker.io/sourcegraph/postgres_exporter:insiders @sha256:f626c611ea5f4bb9efe184994755dfb64d117d4f50c74fc09665093bf1e6939e '
619621 cpus : 0.1
620622 mem_limit : ' 50m'
621623 networks :
@@ -625,17 +627,13 @@ services:
625627 - ' DATA_SOURCE_NAME=postgres://sg:@codeintel-db:5432/?sslmode=disable'
626628 - ' PG_EXPORTER_EXTEND_QUERY_PATH=/config/code_intel_queries.yaml'
627629
628- # Description: TimescaleDB time-series database for code insights data.
630+ # Description: PostgreSQL database for code insights data.
629631 #
630632 # Disk: 128GB / persistent SSD
631633 # Network: 1Gbps
632634 # Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
633635 # Ports exposed to the public internet: none
634636 #
635- # Note: You should deploy this as a container, do not try to connect it to your external
636- # Postgres deployment (TimescaleDB is a bit special and most hosted Postgres deployments
637- # do not support TimescaleDB, the data here is akin to gitserver's data, where losing it
638- # would be bad but it can be rebuilt given enough time.)
639637 codeinsights-db :
640638 container_name : codeinsights-db
641639 image : ' index.docker.io/sourcegraph/codeinsights-db:insiders@sha256:82fe7f91dbdca1cd397a80f1023d9da4e9c6af103bc36866d800e3a8279eea00'
@@ -644,7 +642,15 @@ services:
644642 shm_size : ' 1g'
645643 environment :
646644 - POSTGRES_PASSWORD=password
645+ - POSTGRES_USER=postgres
646+ - POSTGRES_DB=postgres
647647 - PGDATA=/var/lib/postgresql/data/pgdata
648+ healthcheck :
649+ test : ' /liveness.sh'
650+ interval : 10s
651+ timeout : 1s
652+ retries : 10
653+ start_period : 15s
648654 volumes :
649655 - ' codeinsights-db:/var/lib/postgresql/data/'
650656 - ' ../codeinsights-db/conf:/conf/'
@@ -653,6 +659,26 @@ services:
653659 restart : always
654660 stop_grace_period : 120s
655661
662+ # Description: This container will collect and expose prometheus metrics about `codeinsights-db` PostgreSQL server.
663+ #
664+ # Disk: None
665+ # Ports exposed to other Sourcegraph services: 9187/TCP
666+ # Ports exposed to the public internet: none
667+ #
668+ # If you're using a DB instance hosted outside of docker-compose, the environment variables
669+ # for this container will need to be updated to reflect the new connection information.
670+ codeinsights-db-exporter :
671+ container_name : codeinsights-db-exporter
672+ image : ' index.docker.io/sourcegraph/postgres_exporter:insiders@sha256:f626c611ea5f4bb9efe184994755dfb64d117d4f50c74fc09665093bf1e6939e'
673+ cpus : 0.1
674+ mem_limit : ' 50m'
675+ networks :
676+ - sourcegraph
677+ restart : always
678+ environment :
679+ - ' DATA_SOURCE_NAME=postgres://postgres:@codeinsights-db:5432/postgres?sslmode=disable'
680+ - ' PG_EXPORTER_EXTEND_QUERY_PATH=/config/code_insights_queries.yaml'
681+
656682 # Description: MinIO for storing LSIF uploads.
657683 #
658684 # Disk: 128GB / persistent SSD
0 commit comments