forked from newrelic/newrelic-kubernetes-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_policy.yaml
48 lines (47 loc) · 1.33 KB
/
example_policy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Note: If using a k8s secret, remove `api_key`, uncomment `api_key_secret`,
# add your API key to examples/example_secret.yaml, and run
# `kubectl apply -f examples/example_secret.yaml`
apiVersion: nr.k8s.newrelic.com/v1
kind: AlertsPolicy
metadata:
name: my-policy
spec:
account_id: <your New Relic account ID>
api_key: <your New Relic personal API key>
# api_key_secret:
# name: nr-api-key
# namespace: default
# key_name: api-key
name: k8s created policy
incidentPreference: "PER_POLICY"
region: "US"
conditions:
- spec:
type: "NRQL"
nrql:
query: "SELECT count(*) FROM Transactions"
evaluationOffset: 10
enabled: true
terms:
- threshold: "75.0"
threshold_occurrences: "ALL"
threshold_duration: 60
priority: "CRITICAL"
operator: "ABOVE"
name: "nrql condition"
violationTimeLimit: "ONE_HOUR"
valueFunction: "SINGLE_VALUE"
- spec:
type: "apm_app_metric"
enabled: true
metric: "apdex"
condition_scope: application
entities:
- "215037795"
apm_terms:
- threshold: "0.9"
time_function: "all"
duration: "5"
priority: "critical"
operator: "above"
name: "apm condition"