Skip to content

Instantly share code, notes, and snippets.

@thoraxe
Last active August 13, 2020 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoraxe/cc6f529d78cad4d1d005d3929acba643 to your computer and use it in GitHub Desktop.
Save thoraxe/cc6f529d78cad4d1d005d3929acba643 to your computer and use it in GitHub Desktop.
custom metrics and alerting content
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: example-alert
spec:
groups:
- name: example
rules:
- alert: TooManyErrorAlert
expr: http_requests_total{code="404"} > 10
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
techPreviewUserWorkload:
enabled: true
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: example-monitor
spec:
endpoints:
- interval: 30s
port: 8080-tcp
scheme: http
selector:
matchLabels:
app: metrics-app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment