Skip to content
Merged
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
17 changes: 16 additions & 1 deletion bin/crunchy-postgres-exporter/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ QUERIES=(
queries_global
queries_per_db
queries_nodemx
queries_pg_stat_statements_reset
)

function trap_sigterm() {
Expand Down Expand Up @@ -175,6 +174,14 @@ else
else
echo_warn "Query file queries_pg_stat_statements.yml not loaded."
fi
# queries_pg_stat_statements_reset is only available in PG12+. This may
# need to be updated based on a new path
if [[ -f ${CONFIG_DIR?}/queries_pg_stat_statements_reset.yml ]];
then
cat ${CONFIG_DIR?}/queries_pg_stat_statements_reset.yml >> /tmp/queries.yml
else
echo_warn "Query file queries_pg_stat_statements_reset.yml not loaded."
fi
elif (( ${VERSION?} >= 130000 ))
then
if [[ -f ${CONFIG_DIR?}/pg13/queries_general.yml ]]
Expand All @@ -189,6 +196,14 @@ else
else
echo_warn "Query file queries_pg_stat_statements.yml not loaded."
fi
# queries_pg_stat_statements_reset is only available in PG12+. This may
# need to be updated based on a new path
if [[ -f ${CONFIG_DIR?}/queries_pg_stat_statements_reset.yml ]];
then
cat ${CONFIG_DIR?}/queries_pg_stat_statements_reset.yml >> /tmp/queries.yml
else
echo_warn "Query file queries_pg_stat_statements_reset.yml not loaded."
fi
else
echo_err "Unknown or unsupported version of PostgreSQL. Exiting.."
exit 1
Expand Down