apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: webrtc-be
  namespace: webrtc-be # Deployed in the app's namespace
  labels:
    # This label isn't strictly needed for selection based on your
    # config, but it's good practice.
    release: prometheus
spec:
  selector:
    matchLabels:
      app: webrtc-be # <-- This MUST match your Service's label
  namespaceSelector:
    matchNames:
    - webrtc-be # The namespace your Service is in
  endpoints:
  - port: websocket-port # <-- This MUST match your Service's port name
    path: /metrics       # The path to your metrics endpoint
    interval: 30s        # How often to scrape
