Skip to content

Commit

Permalink
Split prometheus alerting rules, add new automated recording rules
Browse files Browse the repository at this point in the history
The recording rules can be used by federation
  • Loading branch information
smarterclayton committed Dec 11, 2017
1 parent d1ca9a7 commit db29c1c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions examples/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ objects:
name: prometheus
namespace: "${NAMESPACE}"
data:
prometheus.rules: |
alerting.rules: |
groups:
- name: example-rules
interval: 30s # defaults to global interval
Expand All @@ -255,9 +255,21 @@ objects:
miqTarget: "ContainerNode"
severity: "HIGH"
message: "{{$labels.instance}} is down"
recording.rules: |
groups:
- name: aggregate_container_resources
rules:
- record: container_cpu_usage_rate
expr: sum without (cpu) (rate(container_cpu_usage_seconds_total[3m]))
- record: container_memory_rss_by_type
expr: container_memory_rss{id=~"/|/system.slice|/kubepods.slice"} > 0
- record: container_cpu_usage_percent_by_host
expr: sum by (hostname,type)(rate(container_cpu_usage_seconds_total{id="/"}[3m])) / on (hostname,type) machine_cpu_cores
- record: apiserver_request_count_by_resources
expr: sum without (client,instance,contentType) (rate(apiserver_request_count[5m]))
prometheus.yml: |
rule_files:
- 'prometheus.rules'
- '*.rules'
# A scrape configuration for running Prometheus on a Kubernetes cluster.
# This uses separate scrape configs for cluster components (i.e. API server, node)
Expand Down

0 comments on commit db29c1c

Please sign in to comment.