Skip to content

Commit 4952dbf

Browse files
pierreln-ddclaude
andauthored
[sqlserver] Fix database_autodiscovery_interval config option being ignored (DataDog#22912)
The check was reading `autodiscovery_interval` from the instance config, but the documented (and customer-used) key is `database_autodiscovery_interval`. This mismatch has existed since the feature was introduced in 2020 (PR DataDog#8115), meaning customers setting this option were silently getting the default 3600s. Data shows 124 orgs / 3,320 hosts actively set `database_autodiscovery_interval` in their configs. Fix the code to read the correct key. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 347ad32 commit 4952dbf

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

sqlserver/changelog.d/22912.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ``database_autodiscovery_interval`` config option being silently ignored. The check was reading ``autodiscovery_interval`` instead of the documented ``database_autodiscovery_interval`` key, so customers setting this option were always getting the default 3600s interval.

sqlserver/datadog_checks/sqlserver/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def __init__(self, init_config, instance, log):
3232
self.autodiscovery_exclude: list[str] = instance.get('autodiscovery_exclude', ['model']) or ['model']
3333
self.autodiscovery_db_service_check: bool = is_affirmative(instance.get('autodiscovery_db_service_check', True))
3434
self.min_collection_interval: int = instance.get('min_collection_interval', 15)
35-
self.autodiscovery_interval: int = instance.get('autodiscovery_interval', DEFAULT_AUTODISCOVERY_INTERVAL)
35+
self.autodiscovery_interval: int = instance.get(
36+
'database_autodiscovery_interval', DEFAULT_AUTODISCOVERY_INTERVAL
37+
)
3638
self.database_instance_collection_interval: int = instance.get(
3739
'database_instance_collection_interval', DEFAULT_LONG_METRICS_COLLECTION_INTERVAL
3840
)

0 commit comments

Comments
 (0)