From 100dd2079385d08459c79a6e21329eead0b7ff04 Mon Sep 17 00:00:00 2001 From: Emma Ferguson Date: Wed, 14 Feb 2024 17:11:55 +0000 Subject: [PATCH] update default table schema collection limit to 300 --- postgres/assets/configuration/spec.yaml | 4 ++-- postgres/changelog.d/16880.fixed | 1 + postgres/datadog_checks/postgres/data/conf.yaml.example | 4 ++-- postgres/datadog_checks/postgres/metadata.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 postgres/changelog.d/16880.fixed diff --git a/postgres/assets/configuration/spec.yaml b/postgres/assets/configuration/spec.yaml index 41a8d964b0466..e8e8d26092e34 100644 --- a/postgres/assets/configuration/spec.yaml +++ b/postgres/assets/configuration/spec.yaml @@ -534,8 +534,8 @@ files: Maximum amount of tables the Agent collects from the instance. value: type: number - example: 1000 - display_default: 1000 + example: 300 + display_default: 300 - name: max_columns description: | Maximum amount of columns the Agent collects per table. diff --git a/postgres/changelog.d/16880.fixed b/postgres/changelog.d/16880.fixed new file mode 100644 index 0000000000000..bc7848933bea9 --- /dev/null +++ b/postgres/changelog.d/16880.fixed @@ -0,0 +1 @@ +update default table schema collection limit to 300 diff --git a/postgres/datadog_checks/postgres/data/conf.yaml.example b/postgres/datadog_checks/postgres/data/conf.yaml.example index 93d8df4e0b934..9c322b82898f7 100644 --- a/postgres/datadog_checks/postgres/data/conf.yaml.example +++ b/postgres/datadog_checks/postgres/data/conf.yaml.example @@ -427,10 +427,10 @@ instances: # # enabled: false - ## @param max_tables - number - optional - default: 1000 + ## @param max_tables - number - optional - default: 300 ## Maximum amount of tables the Agent collects from the instance. # - # max_tables: 1000 + # max_tables: 300 ## @param max_columns - number - optional - default: 50 ## Maximum amount of columns the Agent collects per table. diff --git a/postgres/datadog_checks/postgres/metadata.py b/postgres/datadog_checks/postgres/metadata.py index 7116b193563b4..8995329497e98 100644 --- a/postgres/datadog_checks/postgres/metadata.py +++ b/postgres/datadog_checks/postgres/metadata.py @@ -316,7 +316,7 @@ def _get_table_info(self, cursor, dbname, schema_id): If any tables are partitioned, only the master paritition table name will be returned, and none of its children. """ - limit = self._config.schemas_metadata_config.get("max_tables", 1000) + limit = self._config.schemas_metadata_config.get("max_tables", 300) if self._config.relations: if VersionUtils.transform_version(str(self._check.version))["version.major"] == "9": cursor.execute(PG_TABLES_QUERY_V9.format(schema_oid=schema_id))