# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Standalone PodMonitor for KVBM metrics (port 6880).
# Apply this if you cannot upgrade the platform Helm chart.
#
# Usage: kubectl apply -f podmonitor-kvbm.yaml -n monitoring
#
# Scrapes KVBM metrics (port 6880) from worker pods in any namespace.
# Only workers with the kvbm port exposed (e.g. DYN_KVBM_METRICS=true) are scraped.
#
# If your Prometheus Operator watches a different namespace for PodMonitors,
# change metadata.namespace and apply there.
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: dynamo-worker-kvbm
  namespace: monitoring
spec:
  namespaceSelector:
    any: true
  podMetricsEndpoints:
  - interval: 5s
    path: /metrics
    port: kvbm
  selector:
    matchLabels:
      nvidia.com/dynamo-component-type: worker
      nvidia.com/metrics-enabled: "true"
