diff --git a/examples/pilot-letsencrypt/compose.yaml b/examples/pilot-letsencrypt/compose.yaml index 5b900f0..5dbffb6 100644 --- a/examples/pilot-letsencrypt/compose.yaml +++ b/examples/pilot-letsencrypt/compose.yaml @@ -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: diff --git a/examples/pilot-letsencrypt/infra/postgresql-config.yml b/examples/pilot-letsencrypt/infra/postgresql-config.yml index ae8eaff..ae8043c 100644 --- a/examples/pilot-letsencrypt/infra/postgresql-config.yml +++ b/examples/pilot-letsencrypt/infra/postgresql-config.yml @@ -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 '[]'. diff --git a/examples/pilot-letsencrypt/postgres/docker-entrypoint-initdb.d/init-extensions.sql b/examples/pilot-letsencrypt/postgres/docker-entrypoint-initdb.d/init-extensions.sql new file mode 100644 index 0000000..841ff0c --- /dev/null +++ b/examples/pilot-letsencrypt/postgres/docker-entrypoint-initdb.d/init-extensions.sql @@ -0,0 +1 @@ +CREATE EXTENSION IF NOT EXISTS pg_stat_statements; diff --git a/examples/pilot/compose.yaml b/examples/pilot/compose.yaml index e28d3d2..2ad89f4 100644 --- a/examples/pilot/compose.yaml +++ b/examples/pilot/compose.yaml @@ -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: diff --git a/examples/pilot/infra/postgresql-config.yml b/examples/pilot/infra/postgresql-config.yml index ae8eaff..ae8043c 100644 --- a/examples/pilot/infra/postgresql-config.yml +++ b/examples/pilot/infra/postgresql-config.yml @@ -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 '[]'. diff --git a/examples/pilot/postgres/docker-entrypoint-initdb.d/init-extensions.sql b/examples/pilot/postgres/docker-entrypoint-initdb.d/init-extensions.sql new file mode 100644 index 0000000..841ff0c --- /dev/null +++ b/examples/pilot/postgres/docker-entrypoint-initdb.d/init-extensions.sql @@ -0,0 +1 @@ +CREATE EXTENSION IF NOT EXISTS pg_stat_statements;