Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarksdale committed Jul 12, 2021
1 parent c94ba90 commit 5b33a18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions mysql/datadog_checks/mysql/statement_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ..stubs import datadog_agent

from datadog_checks.base import is_affirmative
from datadog_checks.base.utils.common import to_native_string
from datadog_checks.base.utils.db.sql import compute_exec_plan_signature, compute_sql_signature
from datadog_checks.base.utils.db.utils import DBMAsyncJob, RateLimitingTTLCache, default_json_event_encoding
from datadog_checks.base.utils.serialization import json
Expand Down Expand Up @@ -288,8 +289,8 @@ def __init__(self, check, config, connection_args):
'STATEMENT': self._run_explain,
}
self._preferred_explain_strategies = ['PROCEDURE', 'FQ_PROCEDURE', 'STATEMENT']
self._obfuscate_options = json.dumps(
{'quantize_sql_tables': self._config.obfuscator_options.get('quantize_sql_tables', False)}
self._obfuscate_options = to_native_string(
json.dumps({'quantize_sql_tables': self._config.obfuscator_options.get('quantize_sql_tables', False)})
)
self._init_caches()

Expand Down
5 changes: 3 additions & 2 deletions mysql/datadog_checks/mysql/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from datadog_checks.base import is_affirmative
from datadog_checks.base.log import get_check_logger
from datadog_checks.base.utils.common import to_native_string
from datadog_checks.base.utils.db.sql import compute_sql_signature
from datadog_checks.base.utils.db.statement_metrics import StatementMetrics
from datadog_checks.base.utils.db.utils import DBMAsyncJob, default_json_event_encoding
Expand Down Expand Up @@ -77,8 +78,8 @@ def __init__(self, check, config, connection_args):
self._config = config
self.log = get_check_logger()
self._state = StatementMetrics()
self._obfuscate_options = json.dumps(
{'quantize_sql_tables': self._config.obfuscator_options.get('quantize_sql_tables', False)}
self._obfuscate_options = to_native_string(
json.dumps({'quantize_sql_tables': self._config.obfuscator_options.get('quantize_sql_tables', False)})
)
# full_statement_text_cache: limit the ingestion rate of full statement text events per query_signature
self._full_statement_text_cache = TTLCache(
Expand Down

0 comments on commit 5b33a18

Please sign in to comment.