vllm-project / vllm-project/production-stack

feature: Support ServiceMonitors for External Prometheus stack

Open
#606 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request help wanted
Dominant language
Python
Stars
2.6k
Forks
503
Avg merge
4d 17h
Merged PRs (30d)
8

Description

Describe the feature

Enhancement: Support external ServiceMonitors

Add native integration with an already-running Prometheus stack (e.g. the EKS-Blueprints “kube-prometheus-stack” add-on).

Why do you need this feature?

In many production K8s environments a platform team already operates a central Prometheus stack.
But the current vllm-stack chart always creates its own ServiceMonitor only when the bundled observability stack deployment observability/kube-prom-stack.yaml is installed.

Users with existing Prometheus setups (e.g., EKS Blueprint addons) deploy vLLM without that sub-chart, which means:

  • The vLLM router / engine metrics are never scraped.
  • Users must craft and apply a separate ServiceMonitor manifest by hand.

Why it matters

  • Operational simplicity – Teams adopting vLLM shouldn’t have to maintain out-of-tree YAML just to get metrics.
  • Consistency – Seamless integration with existing monitoring infrastructure (e.g. kube-prom-stack, Loki, Tempo)
    • No need for manual ServiceMonitor creation
  • Backward compatibility - with built-in observability stack

Possible enhancement (values & templates)

Add configuration options in values.yaml to conditionally create ServiceMonitors for external Prometheus instances:

externalPrometheus:
  enabled: false          # default – preserves current behaviour
  namespace: "monitoring" # where the Prometheus Operator lives
  labels:                 # label selector for Prometheus (<namespace>/serviceMonitorSelector)
    release: "kube-prometheus-stack"
  serviceSelector:        # optional extra selector for the vLLM Service
    matchExpressions:
      -  key: app.kubernetes.io/managed-by
         operator: In
         values: [ Helm]
      - key: "release"
        operator: In
        values: [test, router] 
     - key: "environment"  
        operator: In  
        values: [test, router]  # Include both test and router environments  

Possible Implementation

  • Add new template helm/templates/external-servicemonitor.yaml
  • Make it conditional based on externalPrometheus.enabled flag
  • Support configurable namespace, labels, and selectors for different Prometheus setups
{{- if .Values.externalPrometheus.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: {{ include "vllm.fullname" . }}
  namespace: {{ .Values.externalPrometheus.namespace }}
  labels: {{- toYaml .Values.externalPrometheus.labels | nindent 4 }}
spec:
  selector: {{- toYaml .Values.externalPrometheus.serviceSelector | nindent 6 }}
  endpoints:
    - port: http-metrics
      interval: 30s
{{- end }}

Current Workaround
Users must manually create and apply ServiceMonitor resources targeting their external Prometheus operators.

Why do you need this feature?

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with values.yaml and the existing observability/kube-prom-stack.yaml ServiceMonitor setup, then compare the chart templates around that resource. Add the proposed helm/templates/external-servicemonitor.yaml integration so externalPrometheus settings control namespace, labels, and service selectors while the default behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
infrastructure, observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.