Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/pilot-letsencrypt/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ services:
retries: 10
ports:
- 127.0.0.1:5432:5432
volumes:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подключение скрипта для entrypoint

- ./postgres/docker-entrypoint-initdb.d/init-extensions.sql:/docker-entrypoint-initdb.d/init-extensions.sql:ro
command:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Изменение конфигурации Postrges для добавления расширения

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

стоит делать что-то вроде

 ./postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro

чтобы было понятно, что это относится к postgres

@darkleaf darkleaf Nov 12, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Feo255 мы можем всю директорию postgres/docker-entrypoint-initdb.d замонтировать, а не по одному файлу, как я выше писал?

- "postgres"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
- "-c"
- "pg_stat_statements.max=10000"
- "-c"
- "pg_stat_statements.track=all"
Comment on lines +40 to +46

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо подумать, возможно есть какой-то ENV, который это все включает. или можно это в конфиг подложить.

То, как сейчас сделано - это на крайний случай

@Feo255 Feo255 Nov 7, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

пробовал и другие варианты. Заработал только этот, но посмотрю ещё.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для справки - вот тут это описывается https://hub.docker.com/_/postgres#database-configuration

<<: *logging

redis:
Expand Down
6 changes: 6 additions & 0 deletions examples/pilot-letsencrypt/infra/postgresql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ integrations:
COLLECTION_LIST: 'ALL'
# COLLECTION_LIST: '["postgres"]'

# Enable query performance monitoring - Defaults to false
Comment thread
darkleaf marked this conversation as resolved.
ENABLE_QUERY_MONITORING : "true"

# Threshold in milliseconds for query response time to fetch individual query performance metrics - Defaults to 1
QUERY_MONITORING_RESPONSE_TIME_THRESHOLD : "1"

# JSON array of database names that will be ignored for metrics collection.
# Typically useful for cases where COLLECTION_LIST is set to 'ALL' and some databases need to be ignored.
# Defaults to empty '[]'.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
10 changes: 10 additions & 0 deletions examples/pilot/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ services:
retries: 10
ports:
- 127.0.0.1:5432:5432
volumes:
- ./postgres/docker-entrypoint-initdb.d/init-extensions.sql:/docker-entrypoint-initdb.d/init-extensions.sql:ro
command:
- "postgres"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
- "-c"
- "pg_stat_statements.max=10000"
- "-c"
- "pg_stat_statements.track=all"
<<: *logging

redis:
Expand Down
6 changes: 6 additions & 0 deletions examples/pilot/infra/postgresql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ integrations:
COLLECTION_LIST: 'ALL'
# COLLECTION_LIST: '["postgres"]'

# Enable query performance monitoring - Defaults to false
ENABLE_QUERY_MONITORING : "true"

# Threshold in milliseconds for query response time to fetch individual query performance metrics - Defaults to 1
QUERY_MONITORING_RESPONSE_TIME_THRESHOLD : "1"

# JSON array of database names that will be ignored for metrics collection.
# Typically useful for cases where COLLECTION_LIST is set to 'ALL' and some databases need to be ignored.
# Defaults to empty '[]'.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;