Skip to content

Commit

Permalink
Increase postgres default query timeout to 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
justiniso committed Aug 5, 2021
1 parent a8541e5 commit 5eaa19a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion postgres/datadog_checks/postgres/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, instance):
if not self.isascii(self.application_name):
raise ConfigurationError("Application name can include only ASCII characters: %s", self.application_name)

self.query_timeout = int(instance.get('query_timeout', 2000))
self.query_timeout = int(instance.get('query_timeout', 5000))
self.relations = instance.get('relations', [])
if self.relations and not self.dbname:
raise ConfigurationError('"dbname" parameter must be set when using the "relations" parameter.')
Expand Down
2 changes: 1 addition & 1 deletion postgres/datadog_checks/postgres/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def instance_query_samples(field, value):


def instance_query_timeout(field, value):
return 2000
return 5000


def instance_relations(field, value):
Expand Down
4 changes: 2 additions & 2 deletions postgres/datadog_checks/postgres/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ instances:
#
# ssl: 'false'

## @param query_timeout - integer - optional - default: 2000
## @param query_timeout - integer - optional - default: 5000
## Adds a statement_timeout https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-STATEMENT-TIMEOUT
## to all metric collection queries. Aborts any statement that takes more than the specified number of milliseconds,
## starting from the time the command arrives at the server from the client. A value of zero turns this off.
## Cancelled queries won't log any metrics.
#
# query_timeout: 2000
# query_timeout: 5000

## @param relations - (list of string or mapping) - optional
## The list of relations/tables must be specified here to track per-relation (table, index , view, etc.) metrics.
Expand Down

0 comments on commit 5eaa19a

Please sign in to comment.