private void doSendStatusMsg(TcpMsgSender sender) {
        AgentStatus data = AgentStatusManager.getInstance().getStatus();
        LOGGER.info("status detail: {}", data);
        if (sender == null) {
            return;
        }
        try {
            ProcessResult procResult = new ProcessResult();
            long dataTime = AgentUtils.getCurrentTime();
            byte[] body = data.getFieldsString().getBytes(StandardCharsets.UTF_8);
            if (!sender.sendMessage(new TcpEventInfo(INLONG_AGENT_SYSTEM,
                    INLONG_AGENT_STATUS, dataTime, null, body), procResult)) {
                LOGGER.error("send status failed: ret = {}", procResult);
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_SEND_FAILED, INLONG_AGENT_SYSTEM, INLONG_AGENT_STATUS,
                        dataTime, 1, body.length);
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_SEND_FAILED_REAL_TIME, INLONG_AGENT_SYSTEM,
                        INLONG_AGENT_STATUS, dataTime, 1, body.length);
            } else {
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_SEND_SUCCESS, INLONG_AGENT_SYSTEM, INLONG_AGENT_STATUS,
                        dataTime, 1, body.length);
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_SEND_SUCCESS_REAL_TIME, INLONG_AGENT_SYSTEM,
                        INLONG_AGENT_STATUS, dataTime, 1, body.length);
            }
        } catch (Throwable ex) {
            LOGGER.error("send status throw exception", ex);
        }
    }
Collect various indicators of agent processes for backend problem analysis
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentStatusManager.java