# ServiceMonitor for scraping worker metrics with Prometheus.
# Requires Prometheus Operator to be installed.
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: rdev-worker
  namespace: rdev
  labels:
    app.kubernetes.io/name: rdev-worker
    app.kubernetes.io/part-of: rdev
    release: prometheus  # Matches Prometheus Operator label selector
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: rdev-worker
  namespaceSelector:
    matchNames:
      - rdev
  endpoints:
    - port: claudebox
      path: /metrics
      interval: 30s
      scrapeTimeout: 10s
---
# ServiceMonitor for rdev-api (queue metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: rdev-api
  namespace: rdev
  labels:
    app.kubernetes.io/name: rdev-api
    app.kubernetes.io/part-of: rdev
    release: prometheus
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: rdev-api
  namespaceSelector:
    matchNames:
      - rdev
  endpoints:
    - port: http
      path: /metrics
      interval: 30s
      scrapeTimeout: 10s
