Todos los productos
Search
Centro de documentos

Application Real-Time Monitoring Service:Monitoreo de los motores de inference vLLM y SGLang

Última actualización: Sep 19, 2026

El agente de Python de Application Monitoring ahora incluye un plugin para vLLM y SGLang que le permite observar estos motores de inference.

Nota

Actualmente, Application Real-Time Monitoring Service (ARMS) admite la observability únicamente para vLLM/SGLang framework.

Procedimiento

Paso 1: Preparar las variables de entorno

export ARMS_APP_NAME=xxx   # The name of the Elastic Algorithm Service (EAS) application.
export ARMS_REGION_ID=xxx   # The region ID for your Alibaba Cloud account.
export ARMS_LICENSE_KEY=xxx   # Your Alibaba Cloud license key.
export APSARA_APM_MODEL_SERVICE_FRAMEWORK=xxx # The type of the model-serving framework. Valid values: 1. vLLM-v0 2. vLLM-v1 3. SGLang

Paso 2: Modificar el comando del motor de inference

  1. Modifique el comando de ejecución del motor de inference.

    A continuación se muestra un ejemplo con el modelo DeepSeek-R1-Distill-Qwen-7B.

    Comando original de vLLM:

    gpu_count=$(nvidia-smi --query-gpu=count --format=csv,noheader | wc -l);vllm serve /model_dir --host 0.0.0.0 --port 8000 --root-path '/' --trust-remote-code --gpu-memory-utilization 0.95 --max-model-len 32768 --tensor-parallel-size $gpu_count --served-model-name DeepSeek-R1-Distill-Qwen-7B

    Comando de vLLM modificado con la observability de ARMS:

    gpu_count=$(nvidia-smi --query-gpu=count --format=csv,noheader | wc -l);export PIP_INDEX_URL=http://mirrors.cloud.aliyuncs.com/pypi/simple;export PIP_TRUSTED_HOST=mirrors.cloud.aliyuncs.com;export APSARA_APM_MODEL_SERVICE_FRAMEWORK=vLLM-v1;pip3 install aliyun-bootstrap;ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;ARMS_APP_NAME=qwq32 ARMS_LICENSE_KEY=it0kjz0oxz@3115ad****** ARMS_REGION_ID=cn-hangzhou aliyun-instrument vllm serve /model_dir --host 0.0.0.0 --port 8000 --root-path '/' --trust-remote-code --gpu-memory-utilization 0.95 --max-model-len 32768 --tensor-parallel-size $gpu_count --served-model-name DeepSeek-R1-Distill-Qwen-7B

    Las modificaciones incluyen los siguientes pasos:

    1. Configure el repositorio de PyPI. Ajuste este valor según sus necesidades.

      export PIP_INDEX_URL=http://mirrors.cloud.aliyuncs.com/pypi/simple;export PIP_TRUSTED_HOST=mirrors.cloud.aliyuncs.com;
    2. Configure el tipo de motor de inference.

      export APSARA_APM_MODEL_SERVICE_FRAMEWORK=vLLM-v1;
    3. Descargue el instalador del agente.

      pip3 install aliyun-bootstrap;
    4. Utilice el instalador para instalar el agente.

      Reemplace cn-hangzhou por su región real.

      ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;

    Comando original de SGLang:

    python -m sglang.launch_server --model-path /model_dir

    Comando de SGLang modificado con la observability de ARMS:

    export PIP_INDEX_URL=http://mirrors.cloud.aliyuncs.com/pypi/simple;export PIP_TRUSTED_HOST=mirrors.cloud.aliyuncs.com;export APSARA_APM_MODEL_SERVICE_FRAMEWORK=SGLang;pip3 install aliyun-bootstrap;ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;ARMS_APP_NAME=qwq32 ARMS_LICENSE_KEY=it0kjz0oxz@3115ad****** ARMS_REGION_ID=cn-hangzhou aliyun-instrument python -m sglang.launch_server --model-path /model_dir

    Las modificaciones incluyen los siguientes pasos:

    1. Configure el repositorio de PyPI. Ajuste este valor según sus necesidades.

      export PIP_INDEX_URL=http://mirrors.cloud.aliyuncs.com/pypi/simple; export PIP_TRUSTED_HOST=mirrors.cloud.aliyuncs.com;
    2. Configure el tipo de motor de inference.

      export APSARA_APM_MODEL_SERVICE_FRAMEWORK=SGLang;
    3. Descargue el instalador del agente.

      pip3 install aliyun-bootstrap;
    4. Utilice el instalador para instalar el agente.

      Reemplace cn-hangzhou por su región real.

      ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;
  2. Haga clic en Update.

Escenarios compatibles

ARMS solo es compatible con las versiones oficiales de vLLM y SGLang. Las versiones modificadas no se admiten. Para consultar la lista de versiones compatibles, consulte LLM services.

Escenario

vLLM V0

vLLM V1

SGLang

Llamadas de Chat/Completion

Compatible

Compatible

Compatible

Llamadas de embedding

Compatible

Compatible

No compatible

Llamadas de Rerank

No compatible

Compatible

No compatible

Duración de transferencia de caché KV

No compatible

Compatible

Compatible

Duración de ejecución del tokenizer o DeTokenizer

No compatible

Compatible

Compatible

Preguntas frecuentes

¿Cómo configuro el framework vLLM para incluir el TraceID en los registros?

Para incluir el TraceID en los registros del framework vLLM, establezca las siguientes variables de entorno:

export OTEL_PYTHON_LOG_CORRELATION=true
export OTEL_PYTHON_LOG_LEVEL=info
export OTEL_PYTHON_LOG_FORMAT="%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s trace_sampled=%(otelTraceSampled)s] - %(message)s"
export VLLM_LOGGING_PREFIX="[%(filename)s:%(lineno)d] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s trace_sampled=%(otelTraceSampled)s]"

Después, agregue el parámetro de inicio --enable-log-requests al comando de inicio del framework vLLM para imprimir los registros a nivel de solicitud.

Referencias