Commit Graph

2392 Commits

Author SHA1 Message Date
Björn Rabenstein
165e2d012d
Merge pull request #2456 from vladimiroff/rm-types-matcher
Replace types.Matcher(s)? with labels.Matcher(s)?
2021-01-23 13:11:40 +01:00
Björn Rabenstein
c3c1aefbc2
Merge pull request #2463 from prometheus/beorn7/config
Add JSON marshaling to config.Matchers
2021-01-22 19:46:48 +01:00
beorn7
7561e7643c Add JSON marshaling to config.Matchers
I have found out that we still need this for the v1 API (and possibly
elsewhere).

Signed-off-by: beorn7 <beorn@grafana.com>
2021-01-22 16:44:23 +01:00
Kiril Vladimirov
f85651f2c4 Marshal Matcher to JSON for API v1 compatibility
Signed-off-by: Kiril Vladimirov <kiril@vladimiroff.org>
2021-01-22 17:03:27 +02:00
Kiril Vladimirov
97e0c754c0 Remove NewRegexpMatcher and panic on error instead
Signed-off-by: Kiril Vladimirov <kiril@vladimiroff.org>
2021-01-22 17:03:24 +02:00
Kiril Vladimirov
f5382af591 silence: Add tests for Not(Equal|Regexp) matchers
... and fix a bug in validating silences with such matchers, caught
while writing them.

Signed-off-by: Kiril Vladimirov <kiril@vladimiroff.org>
2021-01-22 17:02:50 +02:00
Kiril Vladimirov
91083d6cd9 types: Fix typo in Silence.Matchers' documentation
Signed-off-by: Kiril Vladimirov <kiril@vladimiroff.org>
2021-01-22 17:02:50 +02:00
Kiril Vladimirov
7320d83cbc Replace types.Matcher(s)? with labels.Matcher(s)?
Signed-off-by: Kiril Vladimirov <kiril@vladimiroff.org>
2021-01-22 17:02:48 +02:00
Atibhi Agrawal
4ffba65ff5
Add negative matchers for inhibitors (#2460)
Add new matchers for inhibition rules

Signed-off-by: aSquare14 <atibhi.a@gmail.com>
2021-01-22 15:54:11 +01:00
Julien Pivotto
3f46b62d75
Merge pull request #2459 from prometheus/repo_sync
Synchronize common files from prometheus/prometheus
2021-01-17 02:19:50 +01:00
prombot
bca9422306 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2021-01-17 00:04:09 +00:00
Atibhi Agrawal
6b36afbbec
Add negative matchers for routing. (#2434)
Add negative route matchers using label.Matcher

Signed-off-by: aSquare14 <atibhi.a@gmail.com>

Signed-off-by: beorn7 <beorn@grafana.com>

Co-authored-by: Björn Rabenstein <beorn@grafana.com>
2021-01-15 21:11:39 +01:00
Björn Rabenstein
a715283b37
Merge pull request #2441 from prometheus/beorn7/matcher
Improve labels.Matcher
2021-01-15 20:12:16 +01:00
beorn7
99e4a4fbae Address code review comments
Signed-off-by: beorn7 <beorn@grafana.com>
2021-01-13 18:49:06 +01:00
beorn7
e1ab2477c0 Fix escaping for Matcher.String()
Now the string created will correctly parse back.

Signed-off-by: beorn7 <beorn@grafana.com>
2021-01-13 13:21:30 +01:00
Bor Grošelj Simić
dd6b3afebe Remove trailing whitespace in docs
Signed-off-by: Bor Grošelj Simić <bor.groseljsimic@telemach.net>
2021-01-05 16:27:38 +01:00
beorn7
f7742393ae labels.Matcher: Add more test cases
Signed-off-by: beorn7 <beorn@grafana.com>
2020-12-23 23:59:25 +01:00
beorn7
3ce1d888d7 labels.ParseMatchers: Allow escaped quotes
Previously, escaped double quotes would still be seen as ending the
quoting, potentially leading to wronk tokenization.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-12-23 22:37:12 +01:00
beorn7
9bb7ab43cd labels.Matcher: Improve regexp and allow escaping
This addresses a number of issues:

- It was impossible to include a literal '"' or a line break in the value.
- It was impossible to include '=', '~', or '!' in the value.
- It was not validated if the label name is valid.
- It was not validated if the value is valid UTF-8.
- No whitespace was allowed around the operator.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-12-23 21:55:30 +01:00
beorn7
e87985a9a8 Add doc comments to labels.ParseMatcher and labels.ParseMatchers
The doc comments do not describe the current (arguably buggy) state,
but the desired state, as it will be implemented in future commits.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-12-23 20:47:35 +01:00
Björn Rabenstein
ce108378d4
Fix and improve AlertmanagerClusterFailedToSendAlerts (#2437)
The alert was just looking at the minimum across integrations. So a
complete failure of one integration would be masked by a still worknig
other integration. With this fix, the `integration` label is retained
(as it was already expected by the `description`), and thus any
failing integration will trigger the alert.

In addition, an `alertmanagerCriticalIntegrationsRegEx` is provided
that allows to mark integrations as critical. Integrations that are
not used to deliver critical alerts, or those that are just there for
auditing and logging purposes can now be configured to only trigger a
warning alert if they fail.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-12-23 15:15:38 +01:00
Björn Rabenstein
9e1e4fa420
Merge pull request #2435 from prometheus/beorn7/build
Fix docker image build
2020-12-17 01:20:33 +01:00
beorn7
01b9194397 Fix docker image build
New debian image has a nobody group.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-12-16 21:31:12 +01:00
Nicholas Capo
193ebba04d
Display Silence and Alert dates in ISO8601 format (#2363)
* This changes the Alert view the SilenceList and SilenceView

Signed-off-by: Nicholas Capo <nicholas.capo@gmail.com>
2020-12-03 23:06:14 +01:00
Tom Wilkie
6c5dee008f
Beginnings of an Alertmanager mixin. (#1629)
Add an Alertmanager mixin

Signed-off-by: beorn7 <beorn@grafana.com>
Co-authored-by: Tom Wilkie <tom.wilkie@gmail.com>
Co-authored-by: beorn7 <beorn@grafana.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2020-12-03 15:57:42 +01:00
Koki Kato
042d7b34f0
cli: avoid nil dereference in silence update (#2427)
Signed-off-by: Koki Kato <koki.kato1994@gmail.com>
2020-12-02 17:02:12 +01:00
Max Neverov
c39b787800
Add metrics for notification requests (#2361) (#2383)
Signed-off-by: Max Neverov <neverov.max@gmail.com>
2020-11-06 15:24:18 +01:00
PrometheusBot
3974abd0f4
Update common Prometheus files (#2411)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2020-11-06 12:28:36 +01:00
Victor Araujo
846c04e807
Make filter labels consistent with Prometheus (#2403)
* Make filter labels consistent with Prometheus

Filtering the alert out when the label is missing precludes a
possible match for an empty value. This change allows the
match to be evaluated.

Closes #2342

Signed-off-by: Victor Araujo <vear91@gmail.com>

* Add tests for matchFilterLabels in v2 api

Signed-off-by: Victor Araujo <vear91@gmail.com>
2020-11-06 11:26:32 +01:00
PrometheusBot
6e7f922d3a
Update common Prometheus files (#2401)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2020-10-28 18:09:58 +01:00
Isaac Gaskin
10ecddd9a6
docs(readme): correcting hyperlink text for RFC url (#2396)
Signed-off-by: Isaac Gaskin <igaskin@tesla.com>
2020-10-20 22:17:02 +02:00
B++
00b86d9067
setting favicon.ico dinamically (#2392)
* added favico link with relative path

Signed-off-by: jberny <f.bernardi89@gmail.com>

* re-generated assets

Signed-off-by: jberny <f.bernardi89@gmail.com>
2020-10-15 11:10:48 +02:00
Gerard Ryan
a8ed0d5850
Add some missing PagerDuty fields to docs (#2380)
These fields are all available on the PagerdutyConfig type:
59a96579cc/config/notifiers.go (L201..L203)

I took the descriptions from the PagerDuty events-api-v2 docs:
https://developer.pagerduty.com/docs/events-api-v2/overview/

Signed-off-by: Gerard Ryan <gryan@redhat.com>
2020-09-28 15:52:37 +02:00
Kevin Hellemun
dd1a8fb77b
[#2372] Move config reload metrics to Coordinator.Reload() (#2373)
* prometheus/alertmanager#2372 Move config reload metrics to Coordinator.Reload()

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* #2372 Minor refactoring.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>
2020-09-28 14:43:57 +02:00
Benoît Knecht
59a96579cc
notify/pagerduty: Filter out empty images and links (#2379)
PagerDuty Event API v2 [1] requires images to have an `src` property, and links
to have an `href` property.

This commit filters out images and links that don't satisfy those conditions,
to avoid getting an HTTP 400 error in response.

This also adds flexibilty when using templates to configure images and links,
as it's now possible to omit images or links by letting the template return an
empty string for the `src` or `href` property, respectively.

[1]: https://developer.pagerduty.com/docs/events-api-v2/trigger-events/#context-properties

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2020-09-25 17:31:22 +02:00
PrometheusBot
1fdff6b3f9
Update common Prometheus files (#2364)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2020-09-11 18:01:12 +02:00
Julien Pivotto
470634d49f
Update common (#2353)
- Disable HTTP2: https://github.com/prometheus/common/pull/249
- Composite duration: https://github.com/prometheus/common/pull/246

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-08-25 15:48:59 +02:00
Julien Pivotto
565fb4fc00
Remove resolve timeout from the config shipped by default (#2349)
It is not needed with Prometheus and can confuse users.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-08-25 15:46:38 +02:00
Jon Campbell
8e861c646b
Corrected Template Username Casing (#2345)
* Corrected Template Username Casing

Signed-off-by: midnightconman <midnightconman@gmail.com>

* Added assets_vfsdata

Signed-off-by: midnightconman <midnightconman@gmail.com>
2020-08-12 17:53:56 +02:00
Fahri YARDIMCI
41cd012c61
Add alert status for extended and simple output (#2324)
Signed-off-by: Fahri Yardımcı <f.yardimci06@gmail.com>
2020-07-24 15:02:58 +02:00
Julien Pivotto
7d28e5b876
Change HA exemple defaults to be more reasonable (#2325)
10s+10s does not really change.

Give 30s for group wait and 5m for group interval seems better.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-07-24 14:59:27 +02:00
Tim Reddehase
7a4db5c7c0
do not omit "empty" booleans in yaml output (#2317)
The "empty" boolean is the false value. This means that values of false will not
be present in the YAML output. As such they won't be displayed in the config
section on the Status overview page (/#/status), which can be especially
confusing for the SMTPRequireTLS (smtp_require_tls) field of the configuration
as this one will default to true.

Signed-off-by: Tim Reddehase <tim.reddehase@new-work.se>
2020-07-24 14:58:59 +02:00
masataka
73db78741f
Add date picker to silence form views (#2262)
* add datepicker

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* fix import error

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* fix unnecessary import from DateTime package

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* fix unnecessary import utc

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* change datetime picker component

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* added datetime picker utils

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* added datetime picker utils

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* remove config

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* replace case expressions to Result.toMaybe

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
2020-07-24 14:52:29 +02:00
Jason Cooper
277c9ed462
notify: add markdown support for wechat (#2309)
* notify: add markdown support for wechat

Signed-off-by: Jason Cooper <master@deamwork.com>

* docs: update WeChat receiver configuration document

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: check WeChat msgType, apply default if not present

Signed-off-by: Jason Cooper <master@deamwork.com>

* chore: remove unnecessary comment

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: simplify msgType process

Signed-off-by: Jason Cooper <master@deamwork.com>

* docs: wechat configs document update

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: apply error message suggestions

Signed-off-by: Jason Cooper <master@deamwork.com>

* test: add test for regex

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: wechat message safe param

Signed-off-by: Jason Cooper <master@deamwork.com>
2020-07-06 15:56:42 +02:00
Calle Pettersson
1895fde856
Update PagerDuty doc links (#2314)
PagerDuty has restructured their documentation, making links stale

Signed-off-by: Calle Pettersson <calle@cape.nu>
2020-06-28 10:58:02 +02:00
PrometheusBot
51127923f1
Update common Prometheus files (#2310)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2020-06-23 17:04:38 +02:00
Simon Pasquier
13253c8692
docs: document alert's fingerprint (#2308)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-06-18 14:52:39 +02:00
Julien Pivotto
a9d4a71494
Add note about details handling for Opsgenie (#2305)
Signed-off-by: ricoberger <mail@ricoberger.de>

Co-authored-by: ricoberger <mail@ricoberger.de>
2020-06-17 23:36:32 +02:00
Julien Pivotto
3228822f06
Merge pull request #2303 from simonpasquier/merge-release-0.21
Merge release 0.21
2020-06-17 22:19:59 +02:00
Simon Pasquier
a3d98c476a Merge remote-tracking branch 'origin/release-0.21' into merge-release-0.21
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-06-17 16:46:08 +02:00