[ 17.82, 22:11:01 ]
[ 6.38, 22:11:12 ]
[ 2.87, 22:11:38 ]
[ 7.06, 22:12:00 ]
# Boolean
!
,
NOT, not
AND, and
OR, or
IN, in
NOT IN, not in
# Wildcard
pod_name: web-*
cluster:*-trace
create user datadog with password 'datadog';
grant pg_monitor to datadog;
grant SELECT ON pg_stat_database to datadog;
init_config:
instances:
- host: localhost
port: 5432
username: datadog
password: datadog
shared_preload_libraries= pg_stat_statements
track_activity_query_size= 4096
track_io_timing= on
CREATE SCHEMA datadog;
GRANT USAGE ON SCHEMA datadog TO datadog;
GRANT USAGE ON SCHEMA public TO datadog;
GRANT pg_monitor TO datadog;
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
init_config:
instances:
- host: localhost
port: 5432
username: datadog
password: datadog
dbm: true
CREATE OR REPLACE FUNCTION datadog.explain_statement(
l_query TEXT,
OUT explain JSON
)
RETURNS SETOF JSON AS
$$
DECLARE
curs REFCURSOR;
plan JSON;
BEGIN
OPEN curs FOR EXECUTE pg_catalog.concat('EXPLAIN (FORMAT JSON) ', l_query);
FETCH curs INTO plan;
CLOSE curs;
RETURN QUERY SELECT plan;
END;
$$
LANGUAGE 'plpgsql'
RETURNS NULL ON NULL INPUT
SECURITY DEFINER;
logs_enabled: true
logs:
- type: file
path: C:\Program Files\PostgreSQL\15\data\log\postgres.log
service: postgres
source: postgresql
log_processing_rules:
- type: multi_line
pattern: \d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])
name: new_log_start_with_date
logging_collector = on
log_filename = 'postgresql.log'
log_statement = 'all'
log_file_mode = 0644
logs:
- type: file
path: C:/ProgramData/Datadog/logs/agent.log
service: datadog
source: agent
logs:
- type: file
path: C:/ProgramData/Datadog/logs/process-agent.log
service: datadog
source: process-agent