Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
0066de17
Commit
0066de17
authored
Feb 02, 2018
by
Sebastien Badia
Committed by
Brian Brazil
Feb 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: Update rules from the 1.x to 2.x format (#961)
parent
0d4f3e17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
notification_examples.md
content/docs/alerting/notification_examples.md
+11
-8
pushing.md
content/docs/instrumenting/pushing.md
+10
-5
No files found.
content/docs/alerting/notification_examples.md
View file @
0066de17
...
...
@@ -33,15 +33,18 @@ In this example we again customize the text sent to our Slack receiver accessing
Alert
```
ALERT InstanceDown
IF up == 0
FOR 5m
LABELS { severity = "page" }
ANNOTATIONS {
groups:
- name: Instances
rules:
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
severity: page
# Prometheus templates apply here in the annotation and label fields of the alert.
summary = "Instance {{ $labels.instance }} down",
description = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes."
}
annotations:
description: '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.'
summary: 'Instance {{ $labels.instance }} down'
```
Receiver
...
...
content/docs/instrumenting/pushing.md
View file @
0066de17
...
...
@@ -82,9 +82,14 @@ Set up an alert to fire if the job has not run recently. Add the following to
the rules of a Prometheus server that is scraping the Pushgateway:
```
ALERT MyBatchJobNotCompleted
IF min(time() - my_batch_job_last_success_unixtime{job="my_batch_job"}) > 60 * 60
FOR 5m
WITH { severity="page" }
SUMMARY "MyBatchJob has not completed successfully in over an hour"
groups:
- name: MyBatchJob
rules:
- alert: MyBatchJobNotCompleted
expr: min(time() - my_batch_job_last_success_unixtime{job="my_batch_job"}) > 60 * 60
for: 5m
labels:
severity: page
annotations:
summary: MyBatchJob has not completed successfully in over an hour
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment