private Runnable configFetchThread() {
        return () -> {
            Thread.currentThread().setName("ManagerFetcher");
            while (isRunnable()) {
                try {
                    TaskResult taskResult = getStaticConfig();
                    if (taskResult != null) {
                        if (taskResult.getCode().equals(AgentResponseCode.SUCCESS)) {
                            if (agentManager.getTaskManager().getTaskResultVersion() < taskResult.getVersion()) {
                                EventReportUtils.report("", "", AgentUtils.getCurrentTime(),
                                        EventReportUtils.EVENT_TYPE_CONFIG_UPDATE, EventReportUtils.EVENT_LEVEL_INFO,
                                        EvenCodeEnum.CONFIG_UPDATE_SUC, taskResult.toString(),
                                        EvenCodeEnum.CONFIG_UPDATE_SUC.getMessage());
                                List<TaskProfile> taskProfiles = new ArrayList<>();
                                taskResult.getDataConfigs().forEach((config) -> {
                                    TaskProfile profile = TaskProfile.convertToTaskProfile(config);
                                    taskProfiles.add(profile);
                                });
                                agentManager.getTaskManager().submitTaskProfiles(taskProfiles);
                                agentManager.getTaskManager().setTaskResultMd5(taskResult.getMd5());
                                agentManager.getTaskManager().setTaskResultVersion(taskResult.getVersion());
                            } else {
                                EventReportUtils.report("", "", AgentUtils.getCurrentTime(),
                                        EventReportUtils.EVENT_TYPE_CONFIG_UPDATE, EventReportUtils.EVENT_LEVEL_WARN,
                                        EvenCodeEnum.CONFIG_UPDATE_VERSION_NO_CHANGE, taskResult.toString(),
                                        EvenCodeEnum.CONFIG_UPDATE_VERSION_NO_CHANGE.getMessage());
                                LOGGER.warn("%s: %s", EvenCodeEnum.CONFIG_UPDATE_VERSION_NO_CHANGE.getMessage(),
                                        taskResult);
                            }
                        } else if (taskResult.getCode().equals(AgentResponseCode.NO_UPDATE)) {
                            EventReportUtils.report("", "", AgentUtils.getCurrentTime(),
                                    EventReportUtils.EVENT_TYPE_CONFIG_UPDATE, EventReportUtils.EVENT_LEVEL_INFO,
                                    EvenCodeEnum.CONFIG_NO_UPDATE, taskResult.toString(),
                                    EvenCodeEnum.CONFIG_NO_UPDATE.getMessage());
                        } else {
                            EventReportUtils.report("", "", AgentUtils.getCurrentTime(),
                                    EventReportUtils.EVENT_TYPE_CONFIG_UPDATE, EventReportUtils.EVENT_LEVEL_ERROR,
                                    EvenCodeEnum.CONFIG_INVALID_RET_CODE, taskResult.toString(),
                                    EvenCodeEnum.CONFIG_INVALID_RET_CODE.getMessage());
                        }
                    } else {
                        EventReportUtils.report("", "", AgentUtils.getCurrentTime(),
                                EventReportUtils.EVENT_TYPE_CONFIG_UPDATE, EventReportUtils.EVENT_LEVEL_ERROR,
                                EvenCodeEnum.CONFIG_INVALID_RESULT, taskResult.toString(),
                                EvenCodeEnum.CONFIG_INVALID_RESULT.getMessage());
                    }
                    AgentConfigInfo config = getAgentConfigInfo();
                    if (config != null && config.getCode().equals(AgentResponseCode.SUCCESS)) {
                        if (AgentManager.getAgentConfigInfo() == null
                                || AgentManager.getAgentConfigInfo().getVersion() < config.getVersion()) {
                            agentManager.subNewAgentConfigInfo(config);
                        }
                    }
                } catch (Throwable ex) {
                    EventReportUtils.report("", "", AgentUtils.getCurrentTime(),
                            EventReportUtils.EVENT_TYPE_CONFIG_UPDATE, EventReportUtils.EVENT_LEVEL_ERROR,
                            EvenCodeEnum.CONFIG_INVALID_RESULT, ex.getMessage(),
                            EvenCodeEnum.CONFIG_INVALID_RESULT.getMessage());
                    LOGGER.warn("exception caught", ex);
                    ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
                } finally {
                    AgentUtils.silenceSleepInSeconds(AgentUtils.getRandomBySeed(
                            conf.getInt(AGENT_FETCHER_INTERVAL, DEFAULT_AGENT_FETCHER_INTERVAL)));
                }
            }
        };
    }
Thread for profile fetcher.

@return runnable profile.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/fetcher/ManagerFetcher.java