Skip to content

Commit

Permalink
Merge tag 'v0.22.2' into bump-0.22
Browse files Browse the repository at this point in the history
v0.22.2

* tag 'v0.22.2': (181 commits)
  Release 0.22.2
  Include pending silences for future muting decisions
  Release 0.22.1
  Default the isEqual flag to true in alertmanager
  Add test to expose issue prometheus#2426
  Release alertmanager 0.22
  Relase 0.22.0-rc.2
  API: Only pass cluster peer if empty
  fixed small typo
  Release 0.22.0-rc.1
  Fix panic when HA is disabled
  Update matcher examples
  Add prometheus#2276 to release notes
  Release 0.22.0-rc.0
  Lift moratorium on AlertManager receivers with long-term maintenance plan (prometheus#2561)
  Add OAuth 2.0 Config (prometheus#2560)
  Add missing EOL
  Fix flapping acceptance test
  Unlock at specific points instead of deferring
  Dispatch: Make sure mutex gets unlocked on call to Stop
  ...
  • Loading branch information
paulfantom committed Jul 23, 2021
2 parents 47e2f3a + 44f8adc commit be639f5
Show file tree
Hide file tree
Showing 2,032 changed files with 7,239 additions and 550,136 deletions.
28 changes: 22 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: 2.1

orbs:
prometheus: prometheus/prometheus@0.8.0
prometheus: prometheus/prometheus@0.11.0
go: circleci/go@0.2.0

jobs:
Expand All @@ -19,7 +19,7 @@ jobs:
command: sudo rm -rf /usr/local/go
# Whenever the Go version is updated here, .promu.yml should also be updated.
- go/install:
version: "1.14"
version: "1.16"
- run:
name: Remove generated code
command: make clean
Expand All @@ -42,15 +42,15 @@ jobs:
test:
docker:
# Whenever the Go version is updated here, .promu.yml should also be updated.
- image: circleci/golang:1.14
- image: circleci/golang:1.16
# maildev containers are for running the email tests against a "real" SMTP server.
# See notify/email_test.go for details.
- image: djfarrelly/maildev@sha256:624e0ec781e11c3531da83d9448f5861f258ee008c1b2da63b3248bfd680acfa
- image: djfarrelly/maildev:1.1.0
name: maildev-noauth
entrypoint: bin/maildev
command:
- -v
- image: djfarrelly/maildev@sha256:624e0ec781e11c3531da83d9448f5861f258ee008c1b2da63b3248bfd680acfa
- image: djfarrelly/maildev:1.1.0
name: maildev-auth
entrypoint: bin/maildev
command:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# likely to get OOMed and killed.
GOOPTS: "-p 2"
- prometheus/check_proto:
version: "3.11.4"
version: "3.15.8"
- prometheus/store_artifact:
file: alertmanager
- prometheus/store_artifact:
Expand All @@ -99,6 +99,17 @@ jobs:
- store_test_results:
path: test-results

mixin:
docker:
# Whenever the Go version is updated here, .promu.yml should also be updated.
- image: circleci/golang:1.16

steps:
- checkout
- run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: make -C doc/alertmanager-mixin lint

workflows:
version: 2
alertmanager:
Expand All @@ -113,6 +124,11 @@ workflows:
only: /.*/
- prometheus/build:
name: build
parallelism: 8
filters:
tags:
only: /.*/
- mixin:
filters:
tags:
only: /.*/
Expand Down
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@

* Alertmanager version:

insert output of `alertmanager --version` here
insert output of `alertmanager --version` here (repeat for each alertmanager
version in your cluster, if relevant to the issue)

* Prometheus version:

insert output of `prometheus --version` here (if relevant to the issue)
insert output of `prometheus --version` here (repeat for each prometheus
version in your cluster, if relevant to the issue)

* Alertmanager configuration file:
```
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/.build
/.release
/.tarballs
/vendor

!.golangci.yml
!/cli/testdata/*.yml
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
run:
modules-download-mode: vendor
deadline: 5m

issues:
Expand Down
34 changes: 10 additions & 24 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here, .travis.yml and
# .circle/config.yml should also be updated.
version: 1.14
version: 1.16
repository:
path: github.com/prometheus/alertmanager
build:
Expand All @@ -10,7 +10,7 @@ build:
path: ./cmd/alertmanager
- name: amtool
path: ./cmd/amtool
flags: -mod vendor -a -tags netgo
flags: -a -tags netgo
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
Expand All @@ -24,25 +24,11 @@ tarball:
- NOTICE
crossbuild:
platforms:
- linux/amd64
- linux/386
- darwin/amd64
- darwin/386
- windows/amd64
- windows/386
- freebsd/amd64
- freebsd/386
- openbsd/amd64
- openbsd/386
- netbsd/amd64
- netbsd/386
- dragonfly/amd64
- linux/arm
- linux/arm64
- freebsd/arm
- netbsd/arm
- linux/ppc64
- linux/ppc64le
- linux/mips64
- linux/mips64le
- linux/s390x
- darwin
- dragonfly
- freebsd
- illumos
- linux
- netbsd
- openbsd
- windows
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
## 0.22.2 / 2021-06-01

* [BUGFIX] Include pending silences for future muting decisions. #2590

## 0.22.1 / 2021-05-27

This release addresses a regression in the API v1 that was introduced in 0.22.0.
Matchers in silences created with the API v1 could be considered negative
matchers. This affects users using amtool prior to v0.17.0.

* [BUGFIX] API v1: Decode matchers without isEqual are positive matchers. #2603

## 0.22.0 / 2021-05-21

* [CHANGE] Amtool and Alertmanager binaries help now prints to stdout. #2505
* [CHANGE] Use path relative to the configuration file for certificates and password files. #2502
* [CHANGE] Display Silence and Alert dates in ISO8601 format. #2363
* [FEATURE] Add date picker to silence form views. #2262
* [FEATURE] Add support for negative matchers. #2434 #2460 and many more.
* [FEATURE] Add time-based muting to routing tree. #2393
* [FEATURE] Support TLS and basic authentication on the web server. #2446
* [FEATURE] Add OAuth 2.0 client support in HTTP client. #2560
* [ENHANCEMENT] Add composite durations in the configuration (e.g. 2h20m). #2353
* [ENHANCEMENT] Add follow_redirect option to disable following redirects. #2551
* [ENHANCEMENT] Add metric for permanently failed notifications. #2383
* [ENHANCEMENT] Add support for custom authorization scheme. #2499
* [ENHANCEMENT] Add support for not following HTTP redirects. #2499
* [ENHANCEMENT] Add support to set the Slack URL from a file. #2534
* [ENHANCEMENT] amtool: Add alert status to extended and simple output. #2324
* [ENHANCEMENT] Do not omit false booleans in the configuration page. #2317
* [ENHANCEMENT] OpsGenie: Propagate labels to Opsgenie details. #2276
* [ENHANCEMENT] PagerDuty: Filter out empty images and links. #2379
* [ENHANCEMENT] WeChat: add markdown support. #2309
* [BUGFIX] Fix a possible deadlock on shutdown. #2558
* [BUGFIX] UI: Fix extended printing of regex sign. #2445
* [BUGFIX] UI: Fix the favicon when using a path prefix. #2392
* [BUGFIX] Make filter labels consistent with Prometheus. #2403
* [BUGFIX] alertmanager_config_last_reload_successful takes templating failures into account. #2373
* [BUGFIX] amtool: avoid nil dereference in silence update. #2427
* [BUGFIX] VictorOps: Catch routing_key templating errors. #2467

## 0.21.0 / 2020-06-16

This release removes the HipChat integration as it is discontinued by Atlassian on June 30th 2020.
Expand Down
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Prometheus Community Code of Conduct

Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY .build/${OS}-${ARCH}/alertmanager /bin/alertmanager
COPY examples/ha/alertmanager.yml /etc/alertmanager/alertmanager.yml

RUN mkdir -p /alertmanager && \
chown -R nobody:nogroup etc/alertmanager /alertmanager
chown -R nobody:nobody etc/alertmanager /alertmanager

USER nobody
EXPOSE 9093
Expand Down
3 changes: 2 additions & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Simon Pasquier <pasquier.simon@gmail.com>
* Simon Pasquier <pasquier.simon@gmail.com> @simonpasquier
* Andrey Kuzmin <unsoundscapes@gmail.com> @w0rm
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SWAGGER = docker run \
--user=$(shell id -u $(USER)):$(shell id -g $(USER)) \
--rm \
-v $(shell pwd):/go/src/github.com/prometheus/alertmanager \
-w /go/src/github.com/prometheus/alertmanager quay.io/goswagger/swagger:v0.20.1
-w /go/src/github.com/prometheus/alertmanager quay.io/goswagger/swagger:v0.24.0

api/v2/models api/v2/restapi api/v2/client: api/v2/openapi.yaml
-rm -r api/v2/{client,models,restapi}
Expand Down
6 changes: 4 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ ifneq ($(shell which gotestsum),)
endif
endif

PROMU_VERSION ?= 0.5.0
PROMU_VERSION ?= 0.12.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz

GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.18.0
GOLANGCI_LINT_VERSION ?= v1.39.0
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
Expand Down Expand Up @@ -249,10 +249,12 @@ common-docker-publish: $(PUBLISH_DOCKER_ARCHS)
$(PUBLISH_DOCKER_ARCHS): common-docker-publish-%:
docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)"

DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION)))
.PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS)
common-docker-tag-latest: $(TAG_DOCKER_ARCHS)
$(TAG_DOCKER_ARCHS): common-docker-tag-latest-%:
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest"
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)"

.PHONY: common-docker-manifest
common-docker-manifest:
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ is the recommended way of installing Alertmanager.

### Docker images

Docker images are available on [Quay.io](https://quay.io/repository/prometheus/alertmanager).
Docker images are available on [Quay.io](https://quay.io/repository/prometheus/alertmanager) or [Docker Hub](https://hub.docker.com/r/prom/alertmanager/).

You can launch an Alertmanager container for trying it out with

$ docker run --name alertmanager -d -p 127.0.0.1:9093:9093 quay.io/prometheus/alertmanager

Alertmanager will now be reachable at http://localhost:9093/.

### Compiling the binary

Expand Down Expand Up @@ -360,7 +366,7 @@ The chosen port in the `cluster.listen-address` flag is the port that needs to b
specified in the `cluster.peer` flag of the other peers.

The `cluster.advertise-address` flag is required if the instance doesn't have
an IP address that is part of [RFC 6980](https://tools.ietf.org/html/rfc6890)
an IP address that is part of [RFC 6890](https://tools.ietf.org/html/rfc6890)
with a default route.

To start a cluster of three peers on your local machine use [`goreman`](https://github.com/mattn/goreman) and the
Expand Down
6 changes: 6 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Reporting a security issue

The Prometheus security policy, including how to report vulnerabilities, can be
found here:

https://prometheus.io/docs/operating/security/
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.21.0
0.22.2
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type Options struct {
// alert. Mandatory.
StatusFunc func(model.Fingerprint) types.AlertStatus
// Peer from the gossip cluster. If nil, no clustering will be used.
Peer *cluster.Peer
Peer cluster.ClusterPeer
// Timeout for all HTTP connections. The zero value (and negative
// values) result in no timeout.
Timeout time.Duration
Expand Down
39 changes: 25 additions & 14 deletions api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type API struct {
config *config.Config
route *dispatch.Route
uptime time.Time
peer *cluster.Peer
peer cluster.ClusterPeer
logger log.Logger
m *metrics.Alerts

Expand All @@ -88,7 +88,7 @@ func New(
alerts provider.Alerts,
silences *silence.Silences,
sf getAlertStatusFn,
peer *cluster.Peer,
peer cluster.ClusterPeer,
l log.Logger,
r prometheus.Registerer,
) *API {
Expand Down Expand Up @@ -208,15 +208,15 @@ type clusterStatus struct {
Peers []peerStatus `json:"peers"`
}

func getClusterStatus(p *cluster.Peer) *clusterStatus {
func getClusterStatus(p cluster.ClusterPeer) *clusterStatus {
if p == nil {
return nil
}
s := &clusterStatus{Name: p.Name(), Status: p.Status()}

for _, n := range p.Peers() {
s.Peers = append(s.Peers, peerStatus{
Name: n.Name,
Name: n.Name(),
Address: n.Address(),
})
}
Expand Down Expand Up @@ -662,7 +662,7 @@ func matchFilterLabels(matchers []*labels.Matcher, sms map[string]string) bool {
if string(m.Value) == "" && !prs {
continue
}
if !prs || !m.Matches(string(v)) {
if !m.Matches(string(v)) {
return false
}
}
Expand All @@ -684,10 +684,16 @@ func silenceToProto(s *types.Silence) (*silencepb.Silence, error) {
matcher := &silencepb.Matcher{
Name: m.Name,
Pattern: m.Value,
Type: silencepb.Matcher_EQUAL,
}
if m.IsRegex {
switch m.Type {
case labels.MatchEqual:
matcher.Type = silencepb.Matcher_EQUAL
case labels.MatchNotEqual:
matcher.Type = silencepb.Matcher_NOT_EQUAL
case labels.MatchRegexp:
matcher.Type = silencepb.Matcher_REGEXP
case labels.MatchNotRegexp:
matcher.Type = silencepb.Matcher_NOT_REGEXP
}
sil.Matchers = append(sil.Matchers, matcher)
}
Expand All @@ -707,17 +713,22 @@ func silenceFromProto(s *silencepb.Silence) (*types.Silence, error) {
CreatedBy: s.CreatedBy,
}
for _, m := range s.Matchers {
matcher := &types.Matcher{
Name: m.Name,
Value: m.Pattern,
}
var t labels.MatchType
switch m.Type {
case silencepb.Matcher_EQUAL:
t = labels.MatchEqual
case silencepb.Matcher_NOT_EQUAL:
t = labels.MatchNotEqual
case silencepb.Matcher_REGEXP:
matcher.IsRegex = true
default:
return nil, fmt.Errorf("unknown matcher type")
t = labels.MatchRegexp
case silencepb.Matcher_NOT_REGEXP:
t = labels.MatchNotRegexp
}
matcher, err := labels.NewMatcher(t, m.Name, m.Pattern)
if err != nil {
return nil, err
}

sil.Matchers = append(sil.Matchers, matcher)
}

Expand Down
Loading

0 comments on commit be639f5

Please sign in to comment.