Skip to content

Commit

Permalink
[mongo] enable inferred schema collection by default (#18502)
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zhengda authored Sep 5, 2024
1 parent 1af204b commit 240bab5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mongo/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ files:
Enable collection of schemas. Requires `dbm: true`.
value:
type: boolean
example: false
example: true
- name: collection_interval
description: |
Set the schemas collection interval in seconds. Each collection involves sampling documents
Expand Down
1 change: 1 addition & 0 deletions mongo/changelog.d/18502.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enables MongoDB inferred schema collection by default (DBM only).
5 changes: 2 additions & 3 deletions mongo/datadog_checks/mongo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ def slow_operations(self):
@property
def schemas(self):
enabled = False
if self.dbm_enabled is True and self._schemas_config.get('enabled') is True:
# if DBM is enabled and the schemas config is enabled, then it is enabled
# By default, schemas collection is disabled
if self.dbm_enabled is True and self._schemas_config.get('enabled') is not False:
# if DBM is enabled and the schemas config is not explicitly disabled, then it is enabled
enabled = True
max_collections = self._schemas_config.get('max_collections')
return {
Expand Down
4 changes: 2 additions & 2 deletions mongo/datadog_checks/mongo/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ instances:
#
# schemas:

## @param enabled - boolean - optional - default: false
## @param enabled - boolean - optional - default: true
## Enable collection of schemas. Requires `dbm: true`.
#
# enabled: false
# enabled: true

## @param collection_interval - number - optional - default: 600
## Set the schemas collection interval in seconds. Each collection involves sampling documents
Expand Down

0 comments on commit 240bab5

Please sign in to comment.