Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support adding custom recording rules. #1225

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chart/openfaas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -671,3 +671,4 @@ For legacy scaling in OpenFaaS Community Edition.
| `prometheus.retention.time` | When to remove old data from the prometheus db. | `15d` |
| `prometheus.retention.size` | The maximum number of bytes of storage blocks to retain. Units supported: B, KB, MB, GB, TB, PB, EB. 0 meaning disabled. See: [Prometheus storage](https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects)| `0` |
| `prometheus.resources` | Resource limits and requests for prometheus containers | See [values.yaml](./values.yaml) |
| `prometheus.recordingRules` | Custom recording rules for autoscaling. | `[]` |
4 changes: 4 additions & 0 deletions chart/openfaas/templates/prometheus-pro-cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ data:
expr: ceil(sum(irate ( pod_cpu_usage_seconds_total{}[1m])*1000) by (function_name) * on (function_name) avg by (function_name) (gateway_service_target_load{scaling_type="cpu"} > bool 1 ))
labels:
scaling_type: cpu

{{- with .Values.prometheus.recordingRules }}
{{ toYaml . | nindent 6 }}
{{- end }}

- name: recently_started_1m
interval: 10s
Expand Down
1 change: 1 addition & 0 deletions chart/openfaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ prometheus:
memory: "512Mi"
cpu: "100m"
annotations: {}
recordingRules: []

alertmanager:
image: prom/alertmanager:v0.27.0
Expand Down