def METHOD_NAME(self, cursor, query, params=None):
    """
    Run and log the query. If provided, obfuscated params are logged in place of the regular params.
    """
    try:
        self._log.debug("Running query [{}] params={}".format(query, 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