private Long getProcessId() {
        try {
            RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
            String name = runtime.getName();
            String pid = name.substring(0, name.indexOf('@'));
            return Long.parseLong(pid);
        } catch (Exception e) {
            return null;
        }
    }
Collect various indicators of agent processes for backend problem analysis
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentStatusManager.java