*: bump to Go 1.17 (#2792)

* *: bump to Go 1.17

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* *: fix yamllint errors

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier 2021-12-22 14:03:53 +01:00 committed by GitHub
parent dcaa3a05be
commit 48a99764a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 410 additions and 451 deletions

View File

@ -1,10 +1,8 @@
---
version: 2.1
orbs:
prometheus: prometheus/prometheus@0.11.0
go: circleci/go@0.2.0
go: circleci/go@1.7.0
jobs:
test_frontend:
# We need to use a machine executor because the front-end validation runs
@ -12,144 +10,138 @@ jobs:
# executor (even with setup_remote_docker).
machine: true
steps:
- checkout
- run: sudo service docker restart
- run:
name: Remove existing Go installation
command: sudo rm -rf /usr/local/go
# Whenever the Go version is updated here, .promu.yml should also be updated.
- go/install:
version: "1.16"
- run:
name: Remove generated code
command: make clean
- run:
name: Generate front-end code
command: make all
working_directory: ~/project/ui/app
environment:
JUNIT_DIR: ~/test-results
- run:
name: Generate assets
command: make assets
- run:
name: Generate API v2 code
command: make apiv2
- run: git diff --exit-code
- store_test_results:
path: ~/test-results
- checkout
- run: sudo service docker restart
- run:
name: Remove existing Go installation
command: sudo rm -rf /usr/local/go
# Whenever the Go version is updated here, .promu.yml should also be updated.
- go/install:
version: "1.17"
- run:
name: Remove generated code
command: make clean
- run:
name: Generate front-end code
command: make all
working_directory: ~/project/ui/app
environment:
JUNIT_DIR: ~/test-results
- run:
name: Generate assets
command: make assets
- run:
name: Generate API v2 code
command: make apiv2
- run: git diff --exit-code
- store_test_results:
path: ~/test-results
test:
docker:
# Whenever the Go version is updated here, .promu.yml should also be updated.
- 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:1.1.0
name: maildev-noauth
entrypoint: bin/maildev
command:
- -v
- image: djfarrelly/maildev:1.1.0
name: maildev-auth
entrypoint: bin/maildev
command:
- -v
- --incoming-user
- user
- --incoming-pass
- pass
# Whenever the Go version is updated here, .promu.yml should also be updated.
- image: quay.io/prometheus/golang-builder:1.17-base
# maildev containers are for running the email tests against a "real" SMTP server.
# See notify/email_test.go for details.
- image: djfarrelly/maildev:1.1.0
name: maildev-noauth
entrypoint: bin/maildev
command:
- -v
- image: djfarrelly/maildev:1.1.0
name: maildev-auth
entrypoint: bin/maildev
command:
- -v
- --incoming-user
- user
- --incoming-pass
- pass
environment:
EMAIL_NO_AUTH_CONFIG: /tmp/smtp_no_auth.yml
EMAIL_AUTH_CONFIG: /tmp/smtp_auth.yml
steps:
- prometheus/setup_environment
- go/load-cache:
key: v1-go-mod
- run:
command: |
cat \<<EOF > $EMAIL_NO_AUTH_CONFIG
smarthost: maildev-noauth:1025
server: http://maildev-noauth:1080/
EOF
cat \<<EOF > $EMAIL_AUTH_CONFIG
smarthost: maildev-auth:1025
server: http://maildev-auth:1080/
username: user
password: pass
EOF
- run:
command: make
environment:
# By default Go uses GOMAXPROCS but a Circle CI executor has many
# cores (> 30) while the CPU and RAM resources are throttled. If we
# don't limit this to the number of allocated cores, the job is
# likely to get OOMed and killed.
GOOPTS: "-p 2"
- prometheus/check_proto:
version: "3.15.8"
- prometheus/store_artifact:
file: alertmanager
- prometheus/store_artifact:
file: amtool
- go/save-cache:
key: v1-go-mod
- store_test_results:
path: test-results
- prometheus/setup_environment
- go/load-cache:
key: v1-go-mod
- run:
command: |
cat \<<EOF > $EMAIL_NO_AUTH_CONFIG
smarthost: maildev-noauth:1025
server: http://maildev-noauth:1080/
EOF
cat \<<EOF > $EMAIL_AUTH_CONFIG
smarthost: maildev-auth:1025
server: http://maildev-auth:1080/
username: user
password: pass
EOF
- run:
command: make
environment:
# By default Go uses GOMAXPROCS but a Circle CI executor has many
# cores (> 30) while the CPU and RAM resources are throttled. If we
# don't limit this to the number of allocated cores, the job is
# likely to get OOMed and killed.
GOOPTS: "-p 2"
- prometheus/check_proto:
version: "3.15.8"
- prometheus/store_artifact:
file: alertmanager
- prometheus/store_artifact:
file: amtool
- go/save-cache:
key: v1-go-mod
- 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
# Whenever the Go version is updated here, .promu.yml should also be updated.
- image: quay.io/prometheus/golang-builder:1.17-base
steps:
- checkout
- run: cd doc/alertmanager-mixin; go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest
- run: cd doc/alertmanager-mixin; go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: cd doc/alertmanager-mixin; go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
- run: cd doc/alertmanager-mixin; make lint
- checkout
- run: cd doc/alertmanager-mixin; go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest
- run: cd doc/alertmanager-mixin; go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: cd doc/alertmanager-mixin; go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
- run: cd doc/alertmanager-mixin; make lint
workflows:
version: 2
alertmanager:
jobs:
- test_frontend:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
- prometheus/build:
name: build
parallelism: 8
filters:
tags:
only: /.*/
- mixin:
filters:
tags:
only: /.*/
- prometheus/publish_main:
context: org-context
requires:
- test_frontend
- test
- build
filters:
branches:
only: main
- prometheus/publish_release:
context: org-context
requires:
- test_frontend
- test
- build
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/
- test_frontend:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
- prometheus/build:
name: build
parallelism: 8
filters:
tags:
only: /.*/
- mixin:
filters:
tags:
only: /.*/
- prometheus/publish_main:
context: org-context
requires:
- test_frontend
- test
- build
filters:
branches:
only: main
- prometheus/publish_release:
context: org-context
requires:
- test_frontend
- test
- build
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/

View File

@ -1,13 +1,11 @@
---
run:
deadline: 5m
issues:
exclude-rules:
- path: _test.go
linters:
- errcheck
- path: _test.go
linters:
- errcheck
linters-settings:
errcheck:
exclude: scripts/errcheck_excludes.txt

View File

@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here, .travis.yml and
# .circle/config.yml should also be updated.
version: 1.16
version: 1.17
repository:
path: github.com/prometheus/alertmanager
build:

17
.yamllint Normal file
View File

@ -0,0 +1,17 @@
---
extends: default
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
commas: disable
comments: disable
comments-indentation: disable
document-start: disable
indentation:
spaces: consistent
line-length: disable

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build dev
// +build dev
package asset

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build ignore
// +build ignore
package main

View File

@ -1,5 +1,6 @@
// Code generated by vfsgen; DO NOT EDIT.
//go:build !dev
// +build !dev
package asset

View File

@ -1015,7 +1015,7 @@ func TestOpsGenieDeprecatedTeamSpecified(t *testing.T) {
}
const expectedErr = `yaml: unmarshal errors:
line 18: field teams not found in type config.plain`
line 16: field teams not found in type config.plain`
if err.Error() != expectedErr {
t.Errorf("Expected: %s\nGot: %s", expectedErr, err.Error())
}

View File

@ -5,22 +5,16 @@ global:
smtp_auth_password: ''
smtp_hello: ''
slack_api_url: 'https://slack.com/webhook'
templates:
- '/etc/alertmanager/template/*.tmpl'
- '/etc/alertmanager/template/*.tmpl'
route:
group_by: ['alertname', 'cluster', 'service']
receiver: team-X-mails
routes:
- match_re:
service: ^(foo1|foo2|baz)$
receiver: team-X-mails
- match_re:
service: ^(foo1|foo2|baz)$
receiver: team-X-mails
receivers:
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org'
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org'

View File

@ -8,129 +8,110 @@ global:
slack_api_url: "http://mysecret.example.com/"
http_config:
proxy_url: 'http://127.0.0.1:1025'
# The directory from which notification templates are read.
templates:
- '/etc/alertmanager/template/*.tmpl'
- '/etc/alertmanager/template/*.tmpl'
# The root route on which each incoming alert enters.
route:
# The labels by which incoming alerts are grouped together. For example,
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would
# be batched into a single group.
group_by: ['alertname', 'cluster', 'service']
# When a new group of alerts is created by an incoming alert, wait at
# least 'group_wait' to send the initial notification.
# This way ensures that you get multiple alerts for the same group that start
# firing shortly after another are batched together on the first
# notification.
group_wait: 30s
# When the first notification was sent, wait 'group_interval' to send a batch
# of new alerts that started firing for that group.
group_interval: 5m
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval: 3h
# A default receiver
receiver: team-X-mails
# All the above attributes are inherited by all child routes and can
# overwritten on each.
# The child route trees.
routes:
# This routes performs a regular expression match on alert labels to
# catch alerts that are related to a list of services.
- match_re:
service: ^(foo1|foo2|baz)$
receiver: team-X-mails
# The service has a sub-route for critical alerts, any alerts
# that do not match, i.e. severity != critical, fall-back to the
# parent node and are sent to 'team-X-mails'
routes:
# This routes performs a regular expression match on alert labels to
# catch alerts that are related to a list of services.
- match_re:
service: ^(foo1|foo2|baz)$
receiver: team-X-mails
# The service has a sub-route for critical alerts, any alerts
# that do not match, i.e. severity != critical, fall-back to the
# parent node and are sent to 'team-X-mails'
routes:
- match:
severity: critical
receiver: team-X-pager
- match:
severity: critical
receiver: team-X-pager
- match:
service: files
receiver: team-Y-mails
routes:
service: files
receiver: team-Y-mails
routes:
- match:
severity: critical
receiver: team-Y-pager
# This route handles all alerts coming from a database service. If there's
# no team to handle it, it defaults to the DB team.
- match:
severity: critical
receiver: team-Y-pager
# This route handles all alerts coming from a database service. If there's
# no team to handle it, it defaults to the DB team.
- match:
service: database
receiver: team-DB-pager
# Also group alerts by affected database.
group_by: [alertname, cluster, database]
routes:
- match:
owner2: team-X
receiver: team-X-pager
continue: true
- match:
owner: team-Y
receiver: team-Y-pager
# continue: true
service: database
receiver: team-DB-pager
# Also group alerts by affected database.
group_by: [alertname, cluster, database]
routes:
- match:
owner2: team-X
receiver: team-X-pager
continue: true
- match:
owner: team-Y
receiver: team-Y-pager
# continue: true
# Inhibition rules allow to mute a set of alerts given that another alert is
# firing.
# We use this to mute any warning-level notifications if the same alert is
# already critical.
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
# Apply inhibition if the alertname is the same.
equal: ['alertname', 'cluster', 'service']
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
# Apply inhibition if the alertname is the same.
equal: ['alertname', 'cluster', 'service']
receivers:
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org'
- name: 'team-X-pager'
email_configs:
- to: 'team-X+alerts-critical@example.org'
pagerduty_configs:
- routing_key: "mysecret"
- name: 'team-Y-mails'
email_configs:
- to: 'team-Y+alerts@example.org'
- name: 'team-Y-pager'
pagerduty_configs:
- routing_key: "mysecret"
- name: 'team-DB-pager'
pagerduty_configs:
- routing_key: "mysecret"
- name: victorOps-receiver
victorops_configs:
- api_key: mysecret
routing_key: Sample_route
- name: opsGenie-receiver
opsgenie_configs:
- api_key: mysecret
- name: pushover-receiver
pushover_configs:
- token: mysecret
user_key: key
- name: slack-receiver
slack_configs:
- channel: '#my-channel'
image_url: 'http://some.img.com/img.png'
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org'
- name: 'team-X-pager'
email_configs:
- to: 'team-X+alerts-critical@example.org'
pagerduty_configs:
- routing_key: "mysecret"
- name: 'team-Y-mails'
email_configs:
- to: 'team-Y+alerts@example.org'
- name: 'team-Y-pager'
pagerduty_configs:
- routing_key: "mysecret"
- name: 'team-DB-pager'
pagerduty_configs:
- routing_key: "mysecret"
- name: victorOps-receiver
victorops_configs:
- api_key: mysecret
routing_key: Sample_route
- name: opsGenie-receiver
opsgenie_configs:
- api_key: mysecret
- name: pushover-receiver
pushover_configs:
- token: mysecret
user_key: key
- name: slack-receiver
slack_configs:
- channel: '#my-channel'
image_url: 'http://some.img.com/img.png'

View File

@ -1,10 +1,8 @@
route:
group_by: [...]
group_by: ['...']
group_wait: 30s
group_interval: 5m
repeat_interval: 3h
receiver: team-X
receivers:
- name: 'team-X'
- name: 'team-X'

View File

@ -5,7 +5,7 @@ global:
route:
receiver: team-X-slack
receivers:
- name: 'team-X-slack'
slack_configs:
- http_config:
proxy_url: foo
- name: 'team-X-slack'
slack_configs:
- http_config:
proxy_url: foo

View File

@ -1,10 +1,8 @@
route:
receiver: empty
routes:
- match_re:
invalid_label:
receiver: empty
- match_re:
invalid_label:
receiver: empty
receivers:
- name: empty
- name: empty

View File

@ -1,11 +1,9 @@
route:
receiver: empty
receivers:
- name: empty
- name: empty
inhibit_rules:
- source_match_re:
invalid_source_label:
target_match_re:
severity: critical
- source_match_re:
invalid_source_label:
target_match_re:
severity: critical

View File

@ -1,11 +1,9 @@
route:
receiver: empty
receivers:
- name: empty
- name: empty
inhibit_rules:
- source_match:
severity: critical
target_match_re:
invalid_target_label:
- source_match:
severity: critical
target_match_re:
invalid_target_label:

View File

@ -1,7 +1,6 @@
global:
opsgenie_api_key: asd132
opsgenie_api_key_file: '/global_file'
route:
group_by: ['alertname', 'cluster', 'service']
group_wait: 30s
@ -9,19 +8,18 @@ route:
repeat_interval: 3h
receiver: escalation-Y-opsgenie
routes:
- match:
service: foo
receiver: team-X-opsgenie
- match:
service: foo
receiver: team-X-opsgenie
receivers:
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'
- name: 'escalation-Y-opsgenie'
opsgenie_configs:
- responders:
- name: 'escalation-Y'
type: 'escalation'
api_key: qwe456
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'
- name: 'escalation-Y-opsgenie'
opsgenie_configs:
- responders:
- name: 'escalation-Y'
type: 'escalation'
api_key: qwe456

View File

@ -1,6 +1,5 @@
global:
opsgenie_api_key_file: '/global_file'
route:
group_by: ['alertname', 'cluster', 'service']
group_wait: 30s
@ -8,19 +7,18 @@ route:
repeat_interval: 3h
receiver: escalation-Y-opsgenie
routes:
- match:
service: foo
receiver: team-X-opsgenie
- match:
service: foo
receiver: team-X-opsgenie
receivers:
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'
- name: 'escalation-Y-opsgenie'
opsgenie_configs:
- responders:
- name: 'escalation-Y'
type: 'escalation'
api_key_file: /override_file
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'
- name: 'escalation-Y-opsgenie'
opsgenie_configs:
- responders:
- name: 'escalation-Y'
type: 'escalation'
api_key_file: /override_file

View File

@ -1,6 +1,5 @@
global:
opsgenie_api_key: asd132
route:
group_by: ['alertname', 'cluster', 'service']
group_wait: 30s
@ -8,10 +7,9 @@ route:
repeat_interval: 3h
receiver: escalation-Y-opsgenie
routes:
- match:
service: foo
receiver: team-X-opsgenie
- match:
service: foo
receiver: team-X-opsgenie
receivers:
- name: 'team-X-opsgenie'
opsgenie_configs:

View File

@ -1,6 +1,5 @@
global:
opsgenie_api_key: asd132
route:
group_by: ['alertname', 'cluster', 'service']
group_wait: 30s
@ -8,19 +7,18 @@ route:
repeat_interval: 3h
receiver: escalation-Y-opsgenie
routes:
- match:
service: foo
receiver: team-X-opsgenie
- match:
service: foo
receiver: team-X-opsgenie
receivers:
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'
- name: 'escalation-Y-opsgenie'
opsgenie_configs:
- responders:
- name: 'escalation-Y'
type: 'escalation'
api_key: qwe456
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'
- name: 'escalation-Y-opsgenie'
opsgenie_configs:
- responders:
- name: 'escalation-Y'
type: 'escalation'
api_key: qwe456

View File

@ -5,13 +5,12 @@ route:
repeat_interval: 3h
receiver: team-X-opsgenie
routes:
- match:
service: foo
receiver: team-X-opsgenie
- match:
service: foo
receiver: team-X-opsgenie
receivers:
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'
- name: 'team-X-opsgenie'
opsgenie_configs:
- responders:
- name: 'team-X'
type: 'team'

View File

@ -1,13 +1,11 @@
global:
slack_api_url: "http://mysecret.example.com/"
slack_api_url_file: '/global_file'
route:
receiver: 'slack-notifications'
group_by: [alertname, datacenter, app]
receivers:
- name: 'slack-notifications'
slack_configs:
- channel: '#alerts1'
text: 'test'
- name: 'slack-notifications'
slack_configs:
- channel: '#alerts1'
text: 'test'

View File

@ -1,21 +1,19 @@
global:
slack_api_url_file: '/global_file'
route:
receiver: 'slack-notifications'
group_by: [alertname, datacenter, app]
receivers:
- name: 'slack-notifications'
slack_configs:
# Use global
- channel: '#alerts1'
text: 'test'
# Override global with other file
- channel: '#alerts2'
text: 'test'
api_url_file: '/override_file'
# Override global with inline URL
- channel: '#alerts3'
text: 'test'
api_url: 'http://mysecret.example.com/'
- name: 'slack-notifications'
slack_configs:
# Use global
- channel: '#alerts1'
text: 'test'
# Override global with other file
- channel: '#alerts2'
text: 'test'
api_url_file: '/override_file'
# Override global with inline URL
- channel: '#alerts3'
text: 'test'
api_url: 'http://mysecret.example.com/'

View File

@ -1,9 +1,8 @@
route:
receiver: 'slack-notifications'
group_by: [alertname, datacenter, app]
receivers:
- name: 'slack-notifications'
slack_configs:
- channel: '#alerts'
text: 'test'
- name: 'slack-notifications'
slack_configs:
- channel: '#alerts'
text: 'test'

View File

@ -1,7 +1,6 @@
route:
receiver: 'sns-api-notifications'
group_by: [alertname]
receivers:
- name: 'sns-api-notifications'
sns_configs:

View File

@ -1,15 +1,14 @@
route:
receiver: 'sns-api-notifications'
group_by: [alertname]
receivers:
- name: 'sns-api-notifications'
sns_configs:
- api_url: https://sns.us-east-2.amazonaws.com
topic_arn: arn:aws:sns:us-east-2:123456789012:My-Topic
sigv4:
region: us-east-2
access_key: access_key
secret_key: secret_ket
attributes:
severity: Sev2
- name: 'sns-api-notifications'
sns_configs:
- api_url: https://sns.us-east-2.amazonaws.com
topic_arn: arn:aws:sns:us-east-2:123456789012:My-Topic
sigv4:
region: us-east-2
access_key: access_key
secret_key: secret_ket
attributes:
severity: Sev2

View File

@ -1,6 +1,5 @@
global:
victorops_api_key: asd132
route:
group_by: ['alertname', 'cluster', 'service']
group_wait: 30s
@ -8,15 +7,14 @@ route:
repeat_interval: 3h
receiver: team-Y-victorops
routes:
- match:
service: foo
receiver: team-X-victorops
- match:
service: foo
receiver: team-X-victorops
receivers:
- name: 'team-X-victorops'
victorops_configs:
- routing_key: 'team-X'
- name: 'team-Y-victorops'
victorops_configs:
- routing_key: 'team-Y'
api_key: qwe456
- name: 'team-X-victorops'
victorops_configs:
- routing_key: 'team-X'
- name: 'team-Y-victorops'
victorops_configs:
- routing_key: 'team-Y'
api_key: qwe456

View File

@ -5,11 +5,10 @@ route:
repeat_interval: 3h
receiver: team-X-victorops
routes:
- match:
service: foo
receiver: team-X-victorops
- match:
service: foo
receiver: team-X-victorops
receivers:
- name: 'team-X-victorops'
victorops_configs:
- routing_key: 'team-X'
- name: 'team-X-victorops'
victorops_configs:
- routing_key: 'team-X'

View File

@ -7,7 +7,7 @@ global:
# The directory from which notification templates are read.
templates:
- '/etc/alertmanager/template/*.tmpl'
- '/etc/alertmanager/template/*.tmpl'
# The root route on which each incoming alert enters.
route:
@ -45,42 +45,42 @@ route:
# The child route trees.
routes:
# This routes performs a regular expression match on alert labels to
# catch alerts that are related to a list of services.
- matchers:
- service=~"foo1|foo2|baz"
receiver: team-X-mails
# The service has a sub-route for critical alerts, any alerts
# that do not match, i.e. severity != critical, fall-back to the
# parent node and are sent to 'team-X-mails'
routes:
# This routes performs a regular expression match on alert labels to
# catch alerts that are related to a list of services.
- matchers:
- severity="critical"
receiver: team-X-pager
- matchers:
- service="files"
receiver: team-Y-mails
- service=~"foo1|foo2|baz"
receiver: team-X-mails
# The service has a sub-route for critical alerts, any alerts
# that do not match, i.e. severity != critical, fall-back to the
# parent node and are sent to 'team-X-mails'
routes:
- matchers:
- severity="critical"
receiver: team-X-pager
- matchers:
- service="files"
receiver: team-Y-mails
routes:
- matchers:
- severity="critical"
receiver: team-Y-pager
routes:
- matchers:
- severity="critical"
receiver: team-Y-pager
# This route handles all alerts coming from a database service. If there's
# no team to handle it, it defaults to the DB team.
- matchers:
- service="database"
receiver: team-DB-pager
# Also group alerts by affected database.
group_by: [alertname, cluster, database]
routes:
# This route handles all alerts coming from a database service. If there's
# no team to handle it, it defaults to the DB team.
- matchers:
- owner="team-X"
receiver: team-X-pager
continue: true
- matchers:
- owner="team-Y"
receiver: team-Y-pager
- service="database"
receiver: team-DB-pager
# Also group alerts by affected database.
group_by: [alertname, cluster, database]
routes:
- matchers:
- owner="team-X"
receiver: team-X-pager
continue: true
- matchers:
- owner="team-Y"
receiver: team-Y-pager
# Inhibition rules allow to mute a set of alerts given that another alert is
@ -88,35 +88,35 @@ route:
# We use this to mute any warning-level notifications if the same alert is
# already critical.
inhibit_rules:
- source_matchers: [ severity="critical" ]
target_matchers: [ severity="warning" ]
# Apply inhibition if the alertname is the same.
# CAUTION:
# If all label names listed in `equal` are missing
# from both the source and target alerts,
# the inhibition rule will apply!
equal: [ alertname, cluster, service ]
- source_matchers: [severity="critical"]
target_matchers: [severity="warning"]
# Apply inhibition if the alertname is the same.
# CAUTION:
# If all label names listed in `equal` are missing
# from both the source and target alerts,
# the inhibition rule will apply!
equal: [alertname, cluster, service]
receivers:
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org'
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org'
- name: 'team-X-pager'
email_configs:
- to: 'team-X+alerts-critical@example.org'
pagerduty_configs:
- service_key: <team-X-key>
- name: 'team-X-pager'
email_configs:
- to: 'team-X+alerts-critical@example.org'
pagerduty_configs:
- service_key: <team-X-key>
- name: 'team-Y-mails'
email_configs:
- to: 'team-Y+alerts@example.org'
- name: 'team-Y-mails'
email_configs:
- to: 'team-Y+alerts@example.org'
- name: 'team-Y-pager'
pagerduty_configs:
- service_key: <team-Y-key>
- name: 'team-Y-pager'
pagerduty_configs:
- service_key: <team-Y-key>
- name: 'team-DB-pager'
pagerduty_configs:
- service_key: <team-DB-key>
- name: 'team-DB-pager'
pagerduty_configs:
- service_key: <team-DB-key>

View File

@ -5,9 +5,9 @@ route:
repeat_interval: 1h
receiver: 'web.hook'
receivers:
- name: 'web.hook'
webhook_configs:
- url: 'http://127.0.0.1:5001/'
- name: 'web.hook'
webhook_configs:
- url: 'http://127.0.0.1:5001/'
inhibit_rules:
- source_match:
severity: 'critical'

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build tools
// +build tools
// Package tools tracks dependencies for tools that are required to generate the protobuf code.