diff --git a/internlm/monitor/utils.py b/internlm/monitor/utils.py index f64c7dc..34360b5 100644 --- a/internlm/monitor/utils.py +++ b/internlm/monitor/utils.py @@ -14,8 +14,10 @@ def get_job_id(): job_id = "none" if os.getenv("SLURM_JOB_ID") is not None: job_id = os.getenv("SLURM_JOB_ID") - elif os.getenv("K8S_WORKSPACE_ID") is not None: - job_id = os.getenv("K8S_WORKSPACE_ID") + elif os.getenv("KUBERNETES_POD_NAME") is not None: + job_id = os.getenv("KUBERNETES_POD_NAME").split("-")[0] + elif os.getenv("MLP_TASK_INSTANCE_ID") is not None: + job_id = os.getenv("MLP_TASK_ID") return job_id