# Source: firehose-exporter
---

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/custom_rules?/-
  value:
    name: CloudControllerLatencyByGorouter
    rules:
      - record: "cc:firehose_value_metric_gorouter_latency_cloud_controller:avg10m"
        expr: avg(avg_over_time(firehose_value_metric_gorouter_latency_cloud_controller[10m]))

      - &alert
        alert: CloudControllerLatencyByGorouter_Warning
        expr: cc:firehose_value_metric_gorouter_latency_cloud_controller:avg10m > 200
        labels:
          severity: warning
          notify: email
        annotations:
          summary: "Cloud Controller latency as reported by gorouter"
          description: "Average latency of cloud controller calls is high ({{ $value | printf \"%.0f\" }}ms) - this may be due to a high proportion of expensive API calls or it may indicate that the API servers need to be scaled up"

      - <<: *alert
        alert: CloudControllerLatencyByGorouter_Critical
        expr: cc:firehose_value_metric_gorouter_latency_cloud_controller:avg10m > 250
        labels:
          severity: critical
          notify: email

Migrate "Cloud Controller latency as reported by gorouter" monitor to Prometheus
Migrate "Cloud Controller latency as reported by gorouter" monitor to Prometheus

Original DataDog alert:
avg(last_10m):avg:cf.gorouter.latency.CloudController{deployment:%s} > 250
