Previously, escaped double quotes would still be seen as ending the
quoting, potentially leading to wronk tokenization.
Signed-off-by: beorn7 <beorn@grafana.com>
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>
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>
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>
* 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>
* 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>
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>
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>
* 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>