# Source: firehose-exporter
---

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/custom_rules?/-
  value:
    name: CCLogErrorCount
    rules:
      - &alert
        alert: CCLogErrorCount_Warning
        expr: sum(increase(firehose_value_metric_cc_log_count_error[1h])) > 20
        labels:
          severity: warning
          notify: email
        annotations:
          summary: "Cloud Controller API log error count"
          description: "Amount of logged errors in Cloud Controller API grew considerably in the last hour: {{ $value | printf \"%.0f\" }}. See logit.io: '@source.component:cloud_controller_ng AND @level:ERROR'"

      - <<: *alert
        alert: CCLogErrorCount_Critical
        expr: sum(increase(firehose_value_metric_cc_log_count_error[1h])) > 40
        labels:
          severity: critical
          notify: email

Migrate "Cloud Controller API log error count" monitor to Prometheus
Migrate "Cloud Controller API log error count" monitor to Prometheus

Original DataDog monitor:
avg(last_30m):anomalies(sum:cf.cc.log_count.error{deployment:prod}, 'agile', 2, direction='above') >= 0.5

The metric we use is a simple counter, so checking the error count increase
over time should be enough and we don't have to check for anomalies.
