apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  labels:
    release: self-monitoring
  name: metrics-integration-alert
spec:
  groups:
    # Alerts group for VM cluster assumes that Grafana dashboard
    # https://grafana.com/grafana/dashboards/11176 is installed.
    # Please, update the `dashboard` annotation according to your setup.
    - name: metrics-pipeline-alerts
      interval: 30s
      rules:
      - alert: MetricsPipelineTsLagMoreThan1Min
        expr: (metrics_integration_pipeline_upstream_timestamp{} - on (cluster_id) metrics_integration_pipeline_downstream_timestamp{}) > 60
        for: 5m
        labels:
          severity: major
          component: metrics-integration
        annotations:
          component: metrics-integration
          message: "cluster: {{ $labels.cluster_id }}"
          description: "pipeline lag more than 1min, please take a look"
