apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: home-assistant
  labels:
    app.kubernetes.io/instance: home-assistant
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: home-assistant
    helm.sh/chart: home-assistant-5.0.1
  namespace: home-assistant
spec:
  jobLabel: app.kubernetes.io/name
  namespaceSelector:
    matchNames:
      - home-assistant
  selector:
    matchLabels:
      app.kubernetes.io/instance: home-assistant
      app.kubernetes.io/name: home-assistant
      app.kubernetes.io/service: home-assistant-main
  endpoints:
    - bearerTokenSecret:
        key: bearer-token
        name: home-assistant-metric-token
      interval: 3m
      path: /api/prometheus
      port: http
      scrapeTimeout: 1m
