Skip to content

Commit 1d5663c

Browse files
authored
Merge pull request #109 from newrelic/remove-examples
docs: remove hardcoded examples in README
2 parents 3cd8d31 + 6cce562 commit 1d5663c

File tree

1 file changed

+0
-105
lines changed

1 file changed

+0
-105
lines changed

README.md

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -104,51 +104,6 @@ Once you've completed the [Quick Start](#quick-start) section, you can start pro
104104

105105
1. We'll be using the following [example policy](/examples/example_policy.yaml) configuration file. You will need to update the [`api_key`](/examples/example_policy.yaml#10) field with your New Relic [personal API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key). <br>
106106

107-
**examples/example_policy.yaml**
108-
109-
```yaml
110-
apiVersion: nr.k8s.newrelic.com/v1
111-
kind: AlertsPolicy
112-
metadata:
113-
name: my-policy
114-
spec:
115-
# Add your account ID here
116-
account_id: <your New Relic account ID>
117-
# Add your API key here
118-
api_key: <your New Relic personal API key>
119-
name: k8s created policy
120-
incidentPreference: "PER_POLICY"
121-
region: "US"
122-
conditions:
123-
- spec:
124-
type: "NRQL"
125-
nrql:
126-
query: "SELECT count(*) FROM Transactions"
127-
evaluationOffset: 10
128-
enabled: true
129-
terms:
130-
- threshold: "75.0"
131-
threshold_occurrences: "ALL"
132-
threshold_duration: 60
133-
priority: "CRITICAL"
134-
operator: "ABOVE"
135-
name: "K8s generated alert condition"
136-
- spec:
137-
type: "apm_app_metric"
138-
enabled: true
139-
metric: "apdex"
140-
condition_scope: application
141-
entities:
142-
- "5950260"
143-
apm_terms:
144-
- threshold: "0.9"
145-
time_function: "all"
146-
duration: "30"
147-
priority: "critical"
148-
operator: "above"
149-
name: "K8s generated apm alert condition 2"
150-
```
151-
152107
Once you've added your API key, we can apply it your local cluster.
153108
```bash
154109
kubectl apply -f examples/example_policy.yaml
@@ -167,71 +122,11 @@ The operator will create and update alert policies and NRQL alert conditions as
167122

168123
1. We'll be using the following [example NRQL alert condition](/examples/example_nrql_alert_condition.yaml) configuration file. You will need to update the [`api_key`](/examples/example_nrql_alert_condition.yaml#10) field with your New Relic [personal API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key). <br>
169124

170-
**examples/example_nrql_alert_condition.yaml**
171-
172-
```yaml
173-
apiVersion: nr.k8s.newrelic.com/v1
174-
kind: AlertsNrqlCondition
175-
metadata:
176-
name: my-alert-condition
177-
spec:
178-
# Add your account ID here
179-
account_id: <your New Relic account ID>
180-
# Add your API key here
181-
api_key: <your New Relic personal API key>
182-
name: "K8s generated alert condition"
183-
type: "NRQL"
184-
nrql:
185-
# Note: This is just an example.
186-
# You'll want to use a query with parameters that are
187-
# more specific to the needs for targeting associated
188-
# kubernetes objects.
189-
query: "SELECT count(*) FROM Transactions"
190-
evaluationOffset: 10
191-
enabled: true
192-
terms:
193-
- threshold: "75.0"
194-
threshold_occurrences: "ALL"
195-
threshold_duration: 60
196-
priority: "CRITICAL"
197-
operator: "ABOVE"
198-
existing_policy_id: "26458245" # Note: must match an existing policy in your account
199-
region: "US"
200-
```
201-
202125

203126
### Create an Alerts Channel
204127

205128
1. We'll be using the following [example alerts channel](/examples/example_alerts_channel_email.yaml) configuration file. You will need to update the [`api_key`](/examples/example_alerts_channel_email.yaml#6) field with your New Relic [personal API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key). <br>
206129

207-
**examples/example_alerts_channel.yaml**
208-
209-
```yaml
210-
apiVersion: nr.k8s.newrelic.com/v1
211-
kind: AlertsChannel
212-
metadata:
213-
name: my-channel1
214-
spec:
215-
api_key: <your New Relic personal API key>
216-
# api_key_secret:
217-
# name: nr-api-key
218-
# namespace: default
219-
# key_name: api-key
220-
name: "my alert channel"
221-
region: "US"
222-
type: "email"
223-
links:
224-
# Policy links can be by NR PolicyID, NR PolicyName AND/OR K8s AlertPolicy object reference
225-
policy_ids:
226-
- 1
227-
policy_names:
228-
- "k8s created policy"
229-
policy_kubernetes_objects:
230-
- name: "my-policy"
231-
namespace: "default"
232-
configuration:
233-
recipients: "[email protected]"
234-
```
235130

236131
> <small>**Note:** The New Relic Alerts API does not allow updating Alerts Channels. In order to change a channel, you will need to either rename the k8s AlertsChannel object to create a new one and delete the old one or manually delete the k8s AlertsChannel object and create a new one. </small>
237132

0 commit comments

Comments
 (0)