(self, cursor, query, params=None, obfuscated_params=None, obfuscated_query=None)
Run and log the query. If provided, obfuscated params are logged in place of the regular params.
Run and log the query. If provided, obfuscated params are logged in place of the regular params.
Run and log the query . If provided obfuscated params are logged in place of the regular params .
def _cursor_run(self, cursor, query, params=None, obfuscated_params=None, obfuscated_query=None):
        """
        Run and log the query. If provided, obfuscated params are logged in place of the regular params.
        """
        try:
            logged_query = obfuscated_query if obfuscated_query else query
            self._log.debug("Running query [%s] %s", logged_query, obfuscated_params if obfuscated_params else params)
            cursor.execute(query, params)
        except pymysql.DatabaseError as e:
            self._check.count(
                "dd.mysql.db.error",
                1,
                tags=self._tags + ["error:{}".format(type(e))] + self._check._get_debug_tags(),
                hostname=self._check.resolved_hostname,
            )
            raise
def _cursor_run ( self , cursor , query , params = None , obfuscated_params = None , obfuscated_query = None ) : try : logged_query = obfuscated_query if obfuscated_query else query self . _log . debug ( "Running query [%s] %s" , logged_query , obfuscated_params if obfuscated_params else params ) cursor . execute ( query , params ) except pymysql . DatabaseError as e : self . _check . count ( "dd.mysql.db.error" , 1 , tags = self . _tags + [ "error:{}" . format ( type ( e ) ) ] + self . _check . _get_debug_tags ( ) , hostname = self . _check . resolved_hostname , ) raise