Skip to content

Commit

Permalink
Revert "[DBMON-2989] report sql obfuscation error count (#15990)" (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zhengda committed Dec 21, 2023
1 parent 6ba77bb commit c0492e4
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 39 deletions.
1 change: 1 addition & 0 deletions mysql/changelog.d/16439.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Revert "[DBMON-2989] report sql obfuscation error count (#15990)"

Check failure on line 1 in mysql/changelog.d/16439.fixed

View workflow job for this annotation

GitHub Actions / run / Check PR

Your changelog entry has the wrong PR number. To fix this please run: mv mysql/changelog.d/16439.fixed mysql/changelog.d/16493.fixed

Check failure on line 1 in mysql/changelog.d/16439.fixed

View workflow job for this annotation

GitHub Actions / run / Check PR

Your changelog entry has the wrong PR number. To fix this please run: mv mysql/changelog.d/16439.fixed mysql/changelog.d/16493.fixed
7 changes: 1 addition & 6 deletions mysql/datadog_checks/mysql/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def agent_check_getter(self):


class MySQLActivity(DBMAsyncJob):

DEFAULT_COLLECTION_INTERVAL = 10
MAX_PAYLOAD_BYTES = 19e6

Expand Down Expand Up @@ -212,12 +213,6 @@ def _obfuscate_and_sanitize_row(self, row):
else:
self._log.debug("Failed to obfuscate query | err=[%s]", e)
row["sql_text"] = "ERROR: failed to obfuscate"
self._check.count(
"dd.mysql.obfuscation.error",
1,
tags=self.tags + ["error:{}".format(type(e)), "error_msg:{}".format(e)] + self._check._get_debug_tags(),
hostname=self._check.resolved_hostname,
)
return row

@staticmethod
Expand Down
8 changes: 0 additions & 8 deletions mysql/datadog_checks/mysql/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,6 @@ def _normalize_queries(self, rows):
obfuscated_statement = statement['query'] if row['digest_text'] is not None else None
except Exception as e:
self.log.warning("Failed to obfuscate query=[%s] | err=[%s]", row['digest_text'], e)
self._check.count(
"dd.mysql.obfuscation.error",
1,
tags=self.tags
+ ["error:{}".format(type(e)), "error_msg:{}".format(e)]
+ self._check._get_debug_tags(),
hostname=self._check.resolved_hostname,
)
continue

normalized_row['digest_text'] = obfuscated_statement
Expand Down
1 change: 1 addition & 0 deletions postgres/changelog.d/16439.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Revert "[DBMON-2989] report sql obfuscation error count (#15990)"

Check failure on line 1 in postgres/changelog.d/16439.fixed

View workflow job for this annotation

GitHub Actions / run / Check PR

Your changelog entry has the wrong PR number. To fix this please run: mv postgres/changelog.d/16439.fixed postgres/changelog.d/16493.fixed

Check failure on line 1 in postgres/changelog.d/16439.fixed

View workflow job for this annotation

GitHub Actions / run / Check PR

Your changelog entry has the wrong PR number. To fix this please run: mv postgres/changelog.d/16439.fixed postgres/changelog.d/16493.fixed
7 changes: 0 additions & 7 deletions postgres/datadog_checks/postgres/statement_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,6 @@ def _normalize_row(self, row):
tags=self._dbtags(row['datname'], "error:sql-obfuscate") + self._check._get_debug_tags(),
hostname=self._check.resolved_hostname,
)
self._check.count(
"dd.postgres.obfuscation.error",
1,
tags=self._dbtags(row['datname'], "error:{}".format(type(e)), "error_msg:{}".format(e))
+ self._check._get_debug_tags(),
hostname=self._check.resolved_hostname,
)
normalized_row['statement'] = obfuscated_query
return normalized_row

Expand Down
8 changes: 0 additions & 8 deletions postgres/datadog_checks/postgres/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,6 @@ def _normalize_queries(self, rows):
self._log.warning("Failed to obfuscate query=[%s] | err=[%s]", row['query'], e)
else:
self._log.debug("Failed to obfuscate query | err=[%s]", e)
self._check.count(
"dd.postgres.obfuscation.error",
1,
tags=self.tags
+ ["error:{}".format(type(e)), "error_msg:{}".format(e)]
+ self._check._get_debug_tags(),
hostname=self._check.resolved_hostname,
)
continue

obfuscated_query = statement['query']
Expand Down
1 change: 1 addition & 0 deletions sqlserver/changelog.d/16439.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Revert "[DBMON-2989] report sql obfuscation error count (#15990)"

Check failure on line 1 in sqlserver/changelog.d/16439.fixed

View workflow job for this annotation

GitHub Actions / run / Check PR

Your changelog entry has the wrong PR number. To fix this please run: mv sqlserver/changelog.d/16439.fixed sqlserver/changelog.d/16493.fixed

Check failure on line 1 in sqlserver/changelog.d/16439.fixed

View workflow job for this annotation

GitHub Actions / run / Check PR

Your changelog entry has the wrong PR number. To fix this please run: mv sqlserver/changelog.d/16439.fixed sqlserver/changelog.d/16493.fixed
5 changes: 0 additions & 5 deletions sqlserver/datadog_checks/sqlserver/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ def _obfuscate_and_sanitize_row(self, row):
else:
self.log.debug("Failed to obfuscate query | err=[%s]", e)
obfuscated_statement = "ERROR: failed to obfuscate"
self._check.count(
"dd.sqlserver.obfuscation.error",
1,
**self._check.debug_stats_kwargs(tags=["error:{}".format(type(e)), "error_msg:{}".format(e)])
)
row = self._sanitize_row(row, obfuscated_statement)
return row

Expand Down
5 changes: 0 additions & 5 deletions sqlserver/datadog_checks/sqlserver/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,6 @@ def _normalize_queries(self, rows):
1,
**self._check.debug_stats_kwargs(tags=["error:obfuscate-query-{}".format(type(e))])
)
self._check.count(
"dd.sqlserver.obfuscation.error",
1,
**self._check.debug_stats_kwargs(tags=["error:{}".format(type(e)), "error_msg:{}".format(e)])
)
continue

# Extract obfuscated statement and update row fields
Expand Down

0 comments on commit c0492e4

Please sign in to comment.