def METHOD_NAME(self, instance):
    zabbix_user = instance.get('zabbix_user')
    zabbix_pass = instance.get('zabbix_password')
    zabbix_api = instance.get('zabbix_api')
    if not zabbix_user:
        raise ConfigurationError('Configuration error, please specify zabbix_user.')
    if not zabbix_pass:
        raise ConfigurationError('Configuration error, please specify zabbix_pass.')
    if not zabbix_api:
        raise ConfigurationError('Configuration error, please specify zabbix_api.')
    hosts = instance.get('hosts')
    metrics = instance.get('metrics')
    # Get token
    token = self.login(zabbix_user, zabbix_pass, zabbix_api)
    # Get hosts
    if hosts is not None:
        zabbixhosts = self.get_hosts(token, zabbix_api, hosts)
    else:
        zabbixhosts = self.get_hosts(token, zabbix_api)
    hostdic = {}
    hostids = []
    for host in zabbixhosts:
        hostdic[host['hostid']] = host['host']
        hostids.append(host['hostid'])
    # Get items
    if metrics is not None:
        zabbixitems = self.get_items(token, hostids, zabbix_api, metrics)
    else:
        zabbixitems = self.get_items(token, hostids, zabbix_api)
    # Get metrics value
    for item in zabbixitems:
        hostid = item['hostid']
        itemid = item['itemid']
        value_type = item['value_type']
        item_name = item['name']
        if item_name in METRICS:
            history = self.get_history(token, hostid, itemid, value_type, zabbix_api)
            mname = METRICS[item_name]
            # To avoid sending non-numeric values as gauge
            # https://www.zabbix.com/documentation/6.2/en/manual/api/reference/item/object?hl=value_typ#:~:text=ID%7D%2C%20%7BITEM.KEY%7D.-,value_type,-(required) # noqa: E501
            if value_type != '0' and value_type != '3':
                self.log.debug('\"%s\" value is not numeric_float and numeric unsigned', item_name)
                continue
            try:
                dd_metricname = 'zabbix.' + mname
                dd_metricvalue = history[0]['value']
                dd_hostname = hostdic[hostid].replace(' ', '_')
            except Exception as e:
                self.log.debug("Unable to get metric for item %s: %s", itemid, str(e))
            else:
                self.gauge(dd_metricname, dd_metricvalue, tags=self.tags, hostname=dd_hostname, device_name=None)
        else:
            self.log.debug("Item name %s not found in metric mapping", item_name)
    # Revoke token
    result = self.logout(token, zabbix_api)
    self.log.debug("Logged out: %s", result)
    self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.OK, tags=self.tags)