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
84093908
Commit
84093908
authored
Nov 22, 2017
by
Conor Broderick
Committed by
Brian Brazil
Nov 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove rules.md (#922)
parent
48e0b9fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
101 deletions
+2
-101
2016-11-16-interview-with-canonical.md
content/blog/2016-11-16-interview-with-canonical.md
+1
-2
rules.md
content/docs/alerting/rules.md
+0
-98
index.html
content/index.html
+1
-1
No files found.
content/blog/2016-11-16-interview-with-canonical.md
View file @
84093908
...
...
@@ -36,7 +36,7 @@ We’d evaluated a few alternatives, including
Graphite, but our first experiences with Prometheus proved it to have the
combination of simplicity and power that we were looking for. We especially
appreciate the convenience of labels, the simple HTTP protocol, and the out of
box
[
timeseries alerting
](
https://prometheus.io/docs/
alerting/
rules/
)
. The
box
[
timeseries alerting
](
https://prometheus.io/docs/
prometheus/latest/configuration/alerting_
rules/
)
. The
potential with Prometheus to replace 2 different tools (alerting and trending)
with one is particularly appealing.
...
...
@@ -77,4 +77,3 @@ We expect Prometheus to be a significant part of our monitoring and reporting
infrastructure, providing the metrics gathering and storage for numerous
current and future systems. We see it potentially replacing Nagios as for
alerting.
content/docs/alerting/rules.md
deleted
100644 → 0
View file @
48e0b9fb
---
title
:
Alerting rules
sort_rank
:
5
---
# Alerting rules
Alerting rules allow you to define alert conditions based on Prometheus
expression language expressions and to send notifications about firing alerts
to an external service. Whenever the alert expression results in one or more
vector elements at a given point in time, the alert counts as active for these
elements' label sets.
Alerting rules are configured in Prometheus in the same way as
[
recording
rules](/docs/prometheus/latest/configuration/recording_rules).
### Defining alerting rules
Alerting rules are defined in the following syntax:
ALERT <alert name>
IF <expression>
[ FOR <duration> ]
[ LABELS <label set> ]
[ ANNOTATIONS <label set> ]
The alert name must be a valid metric name.
The optional
`FOR`
clause causes Prometheus to wait for a certain duration
between first encountering a new expression output vector element (like an
instance with a high HTTP error rate) and counting an alert as firing for this
element. Elements that are active, but not firing yet, are in pending state.
The
`LABELS`
clause allows specifying a set of additional labels to be attached
to the alert. Any existing conflicting labels will be overwritten. The label
values can be templated.
The
`ANNOTATIONS`
clause specifies another set of labels that are not
identifying for an alert instance. They are used to store longer additional
information such as alert descriptions or runbook links. The annotation values
can be templated.
#### Templating
Label and annotation values can be templated using
[
console templates
](
/docs/visualization/consoles
)
.
The
`$labels`
variable holds the label key/value pairs of an alert instance
and
`$value`
holds the evaluated value of an alert instance.
# To insert a firing element's label values:
{{ $labels.<labelname> }}
# To insert the numeric expression value of the firing element:
{{ $value }}
Examples:
# Alert for any instance that is unreachable for >5 minutes.
ALERT InstanceDown
IF up == 0
FOR 5m
LABELS { severity = "page" }
ANNOTATIONS {
summary = "Instance {{ $labels.instance }} down",
description = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.",
}
# Alert for any instance that have a median request latency >1s.
ALERT APIHighRequestLatency
IF api_http_request_latencies_second{quantile="0.5"} > 1
FOR 1m
ANNOTATIONS {
summary = "High request latency on {{ $labels.instance }}",
description = "{{ $labels.instance }} has a median request latency above 1s (current value: {{ $value }}s)",
}
### Inspecting alerts during runtime
To manually inspect which alerts are active (pending or firing), navigate to
the "Alerts" tab of your Prometheus instance. This will show you the exact
label sets for which each defined alert is currently active.
For pending and firing alerts, Prometheus also stores synthetic time series of
the form
`ALERTS{alertname="<alert name>", alertstate="pending|firing", <additional alert labels>}`
.
The sample value is set to
`1`
as long as the alert is in the indicated active
(pending or firing) state, and a single
`0`
value gets written out when an alert
transitions from active to inactive state. Once inactive, the time series does
not get further updates.
### Sending alert notifications
Prometheus's alerting rules are good at figuring what is broken
*right now*
,
but they are not a fully-fledged notification solution. Another layer is needed
to add summarization, notification rate limiting, silencing and alert
dependencies on top of the simple alert definitions. In Prometheus's ecosystem,
the
[
Alertmanager
](
/docs/alertmanager
)
takes on this
role. Thus, Prometheus may be configured to periodically send information about
alert states to an Alertmanager instance, which then takes care of dispatching
the right notifications. The Alertmanager instance may be configured via the
`-alertmanager.url`
command line flag.
content/index.html
View file @
84093908
...
...
@@ -52,7 +52,7 @@ layout: jumbotron
</a>
</div>
<div
class=
"col-md-3 col-sm-6 col-xs-12 feature-item"
>
<a
href=
"/docs/
alerting/
rules/"
>
<a
href=
"/docs/
prometheus/latest/configuration/alerting_
rules/"
>
<h2><i
class=
"fa fa-warning"
></i>
Precise alerting
</h2>
<p>
Alerts are defined based on Prometheus's flexible query language and maintain dimensional information. An alertmanager handles notifications and silencing.
</p>
</a>
...
...
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