mirror of https://github.com/grafana/grafana.git
				
				
				
			AlertingNG: Add alert provider and basic structure with dispatcher, silences and delivery stages (#31833)
* AlertingNG: Add alert provider Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in> * Add unit tests Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in> * Alertmanager WIP * Merge alertmanager into notifier Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in> * Fixes for PR 31833 (#31990) Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in> * Use alertmanager from upgrad-uuid temporarily to unblock Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in> * Fix lint Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in> Co-authored-by: Josue Abreu <josue@grafana.com>
This commit is contained in:
		
							parent
							
								
									e9402a56ba
								
							
						
					
					
						commit
						ecbc98ba5d
					
				
							
								
								
									
										5
									
								
								go.mod
								
								
								
								
							
							
						
						
									
										5
									
								
								go.mod
								
								
								
								
							|  | @ -27,6 +27,7 @@ require ( | |||
| 	github.com/fatih/color v1.10.0 | ||||
| 	github.com/gchaincl/sqlhooks v1.3.0 | ||||
| 	github.com/getsentry/sentry-go v0.10.0 | ||||
| 	github.com/go-kit/kit v0.10.0 | ||||
| 	github.com/go-macaron/binding v0.0.0-20190806013118-0b4f37bab25b | ||||
| 	github.com/go-macaron/gzip v0.0.0-20160222043647-cad1c6580a07 | ||||
| 	github.com/go-sourcemap/sourcemap v2.1.3+incompatible | ||||
|  | @ -61,9 +62,11 @@ require ( | |||
| 	github.com/opentracing/opentracing-go v1.2.0 | ||||
| 	github.com/patrickmn/go-cache v2.1.0+incompatible | ||||
| 	github.com/pkg/errors v0.9.1 | ||||
| 	github.com/prometheus/alertmanager v0.21.1-0.20210315141118-bf9c43b57df6 | ||||
| 	github.com/prometheus/client_golang v1.9.0 | ||||
| 	github.com/prometheus/client_model v0.2.0 | ||||
| 	github.com/prometheus/common v0.18.1-0.20210305175002-2a23014b3b39 | ||||
| 	github.com/prometheus/prometheus v1.8.2-0.20210217141258-a6be548dbc17 // indirect | ||||
| 	github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967 | ||||
| 	github.com/robfig/cron/v3 v3.0.1 | ||||
| 	github.com/russellhaering/goxmldsig v1.1.0 | ||||
|  | @ -80,7 +83,7 @@ require ( | |||
| 	github.com/yudai/gojsondiff v1.0.0 | ||||
| 	go.opentelemetry.io/collector v0.22.0 | ||||
| 	golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad | ||||
| 	golang.org/x/net v0.0.0-20210119194325-5f4716e94777 | ||||
| 	golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 | ||||
| 	golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 | ||||
| 	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c | ||||
| 	golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 | ||||
|  |  | |||
							
								
								
									
										45
									
								
								go.sum
								
								
								
								
							
							
						
						
									
										45
									
								
								go.sum
								
								
								
								
							|  | @ -129,6 +129,7 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo | |||
| github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= | ||||
| github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= | ||||
| github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= | ||||
| github.com/OneOfOne/xxhash v1.2.6 h1:U68crOE3y3MPttCMQGywZOLrTeF5HHJ3/vDBCJn9/bA= | ||||
| github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= | ||||
| github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= | ||||
| github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= | ||||
|  | @ -174,6 +175,7 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 | |||
| github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= | ||||
| github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= | ||||
| github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= | ||||
| github.com/armon/go-metrics v0.3.3 h1:a9F4rlj7EWWrbj7BYw8J8+x+ZZkJeqzNyRk8hdPF+ro= | ||||
| github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= | ||||
| github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= | ||||
| github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= | ||||
|  | @ -236,8 +238,11 @@ github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9cop | |||
| github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= | ||||
| github.com/cenkalti/backoff v0.0.0-20181003080854-62661b46c409/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= | ||||
| github.com/cenkalti/backoff v1.0.0/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= | ||||
| github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= | ||||
| github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= | ||||
| github.com/cenkalti/backoff/v4 v4.0.2 h1:JIufpQLbh4DkbQoii76ItQIUFzevQSqOLZca4eamEDs= | ||||
| github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= | ||||
| github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc= | ||||
| github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= | ||||
| github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= | ||||
| github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= | ||||
|  | @ -494,6 +499,8 @@ github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpX | |||
| github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= | ||||
| github.com/go-openapi/errors v0.19.9 h1:9SnKdGhiPZHF3ttwFMiCBEb8jQ4IDdrK+5+a0oTygA4= | ||||
| github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= | ||||
| github.com/go-openapi/errors v0.20.0 h1:Sxpo9PjEHDzhs3FbnGNonvDgWcMW2U7wGTcDDSFSceM= | ||||
| github.com/go-openapi/errors v0.20.0/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= | ||||
| github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= | ||||
| github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= | ||||
| github.com/go-openapi/jsonpointer v0.17.2/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= | ||||
|  | @ -534,6 +541,8 @@ github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2g | |||
| github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= | ||||
| github.com/go-openapi/runtime v0.19.24 h1:TqagMVlRAOTwllE/7hNKx6rQ10O6T8ZzeJdMjSTKaD4= | ||||
| github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= | ||||
| github.com/go-openapi/runtime v0.19.26 h1:K/6PoVNj5WJXUnMk+VEbELeXjtBkCS1UxTDa04tdXE0= | ||||
| github.com/go-openapi/runtime v0.19.26/go.mod h1:BvrQtn6iVb2QmiVXRsFAm6ZCAZBpbVKFfN6QWCp582M= | ||||
| github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= | ||||
| github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= | ||||
| github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= | ||||
|  | @ -556,7 +565,6 @@ github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+Z | |||
| github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= | ||||
| github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= | ||||
| github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= | ||||
| github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= | ||||
| github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= | ||||
| github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= | ||||
| github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= | ||||
|  | @ -578,7 +586,6 @@ github.com/go-openapi/validate v0.17.2/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+ | |||
| github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= | ||||
| github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= | ||||
| github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= | ||||
| github.com/go-openapi/validate v0.19.8 h1:YFzsdWIDfVuLvIOF+ZmKjVg1MbPJ1QgY9PihMwei1ys= | ||||
| github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= | ||||
| github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= | ||||
| github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= | ||||
|  | @ -634,6 +641,8 @@ github.com/gocql/gocql v0.0.0-20200526081602-cd04bd7f22a7/go.mod h1:DL0ekTmBSTdl | |||
| github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= | ||||
| github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= | ||||
| github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= | ||||
| github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= | ||||
| github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= | ||||
| github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= | ||||
| github.com/gogo/googleapis v1.3.0 h1:M695OaDJ5ipWvDPcoAg/YL9c3uORAegkEfBqTQF/fTQ= | ||||
| github.com/gogo/googleapis v1.3.0/go.mod h1:d+q1s/xVJxZGKWwC/6UfPIF33J+G1Tq4GYv9Y+Tg/EU= | ||||
|  | @ -701,6 +710,7 @@ github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNu | |||
| github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= | ||||
| github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= | ||||
| github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= | ||||
| github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= | ||||
| github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= | ||||
| github.com/google/flatbuffers v1.11.0 h1:O7CEyB8Cb3/DmtxODGtLHcEvpr81Jm5qLg/hsHnxA2A= | ||||
| github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= | ||||
|  | @ -839,6 +849,7 @@ github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPA | |||
| github.com/hashicorp/consul/sdk v0.5.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= | ||||
| github.com/hashicorp/consul/sdk v0.6.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= | ||||
| github.com/hashicorp/consul/sdk v0.7.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= | ||||
| github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= | ||||
| github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= | ||||
| github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= | ||||
| github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= | ||||
|  | @ -851,10 +862,13 @@ github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0 | |||
| github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= | ||||
| github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= | ||||
| github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= | ||||
| github.com/hashicorp/go-immutable-radix v1.2.0 h1:l6UW37iCXwZkZoAbEYnptSHVE/cQ5bOTPYG5W3vf9+8= | ||||
| github.com/hashicorp/go-immutable-radix v1.2.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= | ||||
| github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= | ||||
| github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= | ||||
| github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= | ||||
| github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= | ||||
| github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= | ||||
| github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= | ||||
| github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= | ||||
| github.com/hashicorp/go-plugin v1.2.2/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= | ||||
|  | @ -865,10 +879,12 @@ github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa | |||
| github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= | ||||
| github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= | ||||
| github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= | ||||
| github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= | ||||
| github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= | ||||
| github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= | ||||
| github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= | ||||
| github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= | ||||
| github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= | ||||
| github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= | ||||
| github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= | ||||
| github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= | ||||
|  | @ -877,6 +893,7 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA | |||
| github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= | ||||
| github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= | ||||
| github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= | ||||
| github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= | ||||
| github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= | ||||
| github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= | ||||
| github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= | ||||
|  | @ -886,6 +903,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p | |||
| github.com/hashicorp/memberlist v0.1.4/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= | ||||
| github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= | ||||
| github.com/hashicorp/memberlist v0.2.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= | ||||
| github.com/hashicorp/memberlist v0.2.2 h1:5+RffWKwqJ71YPu9mWsF7ZOscZmwfasdA8kbdC7AO2g= | ||||
| github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= | ||||
| github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= | ||||
| github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= | ||||
|  | @ -1047,6 +1065,7 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= | |||
| github.com/kshvakov/clickhouse v1.3.5/go.mod h1:DMzX7FxRymoNkVgizH0DWAL8Cur7wHLgx3MUnGwJqpE= | ||||
| github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= | ||||
| github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= | ||||
| github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= | ||||
| github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= | ||||
| github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= | ||||
| github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= | ||||
|  | @ -1146,6 +1165,7 @@ github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKju | |||
| github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= | ||||
| github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= | ||||
| github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= | ||||
| github.com/miekg/dns v1.1.38 h1:MtIY+fmHUVVgv1AXzmKMWcwdCYxTRPG1EDjpqF4RCEw= | ||||
| github.com/miekg/dns v1.1.38/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= | ||||
| github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= | ||||
| github.com/minio/minio-go/v6 v6.0.44/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg= | ||||
|  | @ -1273,6 +1293,7 @@ github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa | |||
| github.com/orijtech/prometheus-go-metrics-exporter v0.0.6/go.mod h1:BiTx/ugZex8LheBk3j53tktWaRdFjV5FCfT2o0P7msE= | ||||
| github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= | ||||
| github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= | ||||
| github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= | ||||
| github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= | ||||
| github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= | ||||
| github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= | ||||
|  | @ -1313,11 +1334,13 @@ github.com/pquerna/cachecontrol v0.0.0-20200819021114-67c6ae64274f/go.mod h1:hoL | |||
| github.com/prometheus/alertmanager v0.18.0/go.mod h1:WcxHBl40VSPuOaqWae6l6HpnEOVRIycEJ7i9iYkadEE= | ||||
| github.com/prometheus/alertmanager v0.19.0/go.mod h1:Eyp94Yi/T+kdeb2qvq66E3RGuph5T/jm/RBVh4yz1xo= | ||||
| github.com/prometheus/alertmanager v0.20.0/go.mod h1:9g2i48FAyZW6BtbsnvHtMHQXl2aVtrORKwKVCQ+nbrg= | ||||
| github.com/prometheus/alertmanager v0.21.0 h1:qK51JcUR9l/unhawGA9F9B64OCYfcGewhPNprem/Acc= | ||||
| github.com/prometheus/alertmanager v0.21.0/go.mod h1:h7tJ81NA0VLWvWEayi1QltevFkLF3KxmC/malTcT8Go= | ||||
| github.com/prometheus/alertmanager v0.21.1-0.20200911160112-1fdff6b3f939/go.mod h1:imXRHOP6QTsE0fFsIsAV/cXimS32m7gVZOiUj11m6Ig= | ||||
| github.com/prometheus/alertmanager v0.21.1-0.20210211203738-a7ca7b1d2951 h1:cRvcZrzWZ55FK2AzBgPk6M6MeWuYEW5ldp/Sv/C/LL4= | ||||
| github.com/prometheus/alertmanager v0.21.1-0.20210211203738-a7ca7b1d2951/go.mod h1:6Yc2n2ap5/oP99x1yN6Ho+yL0w8a0oClIR5xxW/JLGs= | ||||
| github.com/prometheus/alertmanager v0.21.1-0.20210310164430-2d77eab99d95 h1:DGrMZyrXig12aNxJGdHTB1wL6ArrbQIs8J+2nvMJ0U4= | ||||
| github.com/prometheus/alertmanager v0.21.1-0.20210310164430-2d77eab99d95/go.mod h1:MTqVn+vIupE0dzdgo+sMcNCp37SCAi8vPrvKTTnTz9g= | ||||
| github.com/prometheus/alertmanager v0.21.1-0.20210315141118-bf9c43b57df6 h1:XXfT4HND6ZQtBDsOBuTczE/QeKxn6CZz+mUrfWVAwE0= | ||||
| github.com/prometheus/alertmanager v0.21.1-0.20210315141118-bf9c43b57df6/go.mod h1:g6wbBgNXmelfXjJhLLl5NIJDpejM5oEjiSKDsqnTzio= | ||||
| github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= | ||||
| github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= | ||||
| github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= | ||||
|  | @ -1359,7 +1382,6 @@ github.com/prometheus/common v0.12.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16 | |||
| github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= | ||||
| github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= | ||||
| github.com/prometheus/common v0.17.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= | ||||
| github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y= | ||||
| github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= | ||||
| github.com/prometheus/common v0.18.1-0.20210305175002-2a23014b3b39 h1:2B8F94QxZhfNPFQ1jLMjnuOigpr/hVXL7rHFPurXmY8= | ||||
| github.com/prometheus/common v0.18.1-0.20210305175002-2a23014b3b39/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= | ||||
|  | @ -1435,9 +1457,11 @@ github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu | |||
| github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= | ||||
| github.com/satori/go.uuid v0.0.0-20160603004225-b111a074d5ef/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= | ||||
| github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= | ||||
| github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= | ||||
| github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= | ||||
| github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= | ||||
| github.com/schollz/progressbar/v3 v3.3.4/go.mod h1:Rp5lZwpgtYmlvmGo1FyDwXMqagyRBQYSDwzlP9QDu84= | ||||
| github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= | ||||
| github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= | ||||
| github.com/securego/gosec v0.0.0-20200203094520-d13bb6d2420c/go.mod h1:gp0gaHj0WlmPh9BdsTmo1aq6C27yIPWdxCKGFGdVKBE= | ||||
| github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e/go.mod h1:tm/wZFQ8e24NYaBGIlnO2WGCAi67re4HHuOm0sftE/M= | ||||
|  | @ -1453,12 +1477,14 @@ github.com/shirou/gopsutil v3.20.12-0.20201210134652-afe0c04c5d5a+incompatible/g | |||
| github.com/shirou/gopsutil v3.21.2+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= | ||||
| github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= | ||||
| github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= | ||||
| github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= | ||||
| github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= | ||||
| github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= | ||||
| github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= | ||||
| github.com/shurcooL/vfsgen v0.0.0-20180825020608-02ddb050ef6b/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= | ||||
| github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= | ||||
| github.com/shurcooL/vfsgen v0.0.0-20200627165143-92b8a710ab6c/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= | ||||
| github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU= | ||||
| github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= | ||||
| github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8= | ||||
| github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= | ||||
|  | @ -1482,6 +1508,7 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k | |||
| github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= | ||||
| github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a/go.mod h1:LeFCbQYJ3KJlPs/FvPz2dy1tkpxyeNESVyCNNzRXFR0= | ||||
| github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= | ||||
| github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= | ||||
| github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= | ||||
| github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= | ||||
| github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= | ||||
|  | @ -1631,7 +1658,6 @@ go.mongodb.org/mongo-driver v1.1.0/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL | |||
| go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= | ||||
| go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= | ||||
| go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= | ||||
| go.mongodb.org/mongo-driver v1.3.2 h1:IYppNjEV/C+/3VPbhHVxQ4t04eVW0cLp0/pNdW++6Ug= | ||||
| go.mongodb.org/mongo-driver v1.3.2/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= | ||||
| go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= | ||||
| go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= | ||||
|  | @ -1815,6 +1841,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v | |||
| golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | ||||
| golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= | ||||
| golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | ||||
| golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= | ||||
| golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | ||||
| golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= | ||||
| golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= | ||||
| golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | ||||
|  | @ -1826,7 +1854,6 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ | |||
| golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | ||||
| golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | ||||
| golang.org/x/oauth2 v0.0.0-20210210192628-66670185b0cd/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | ||||
| golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 h1:5vD4XjIc0X5+kHZjx4UecYdjA6mJo+XXNoaW0EjU5Os= | ||||
| golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | ||||
| golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 h1:alLDrZkL34Y2bnGHfvC1CYBRBXCXgx8AC2vY4MRtYX4= | ||||
| golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | ||||
|  | @ -1841,7 +1868,6 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ | |||
| golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20200930132711-30421366ff76/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= | ||||
| golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= | ||||
| golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
|  | @ -1944,7 +1970,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w | |||
| golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20210217105451-b926d437f341/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= | ||||
| golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b h1:ggRgirZABFolTmi3sn6Ivd9SipZwLedQ5wR0aAKnFxU= | ||||
| golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
|  | @ -2100,7 +2125,6 @@ google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ | |||
| google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= | ||||
| google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= | ||||
| google.golang.org/api v0.39.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= | ||||
| google.golang.org/api v0.40.0 h1:uWrpz12dpVPn7cojP82mk02XDgTJLDPc2KbVTxrWb4A= | ||||
| google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= | ||||
| google.golang.org/api v0.41.0 h1:12aHIhhQCpWtd3Rcp2WwbboB5W72tJHcjzyA9MCoHAw= | ||||
| google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= | ||||
|  | @ -2167,7 +2191,6 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D | |||
| google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= | ||||
| google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= | ||||
| google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= | ||||
| google.golang.org/genproto v0.0.0-20210302174412-5ede27ff9881 h1:SYuy3hIRsBIROE0aZwsJZOEJNC/n9/p0FmLEU9C31AE= | ||||
| google.golang.org/genproto v0.0.0-20210302174412-5ede27ff9881/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= | ||||
| google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb h1:hcskBH5qZCOa7WpTUFUFvoebnSFZBYpjykLtjIp9DVk= | ||||
| google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= | ||||
|  |  | |||
|  | @ -0,0 +1,108 @@ | |||
| package notifier | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/go-kit/kit/log" | ||||
| 	"github.com/prometheus/alertmanager/api/v2/models" | ||||
| 	"github.com/prometheus/alertmanager/notify" | ||||
| 	"github.com/prometheus/alertmanager/provider" | ||||
| 	"github.com/prometheus/alertmanager/provider/mem" | ||||
| 	"github.com/prometheus/alertmanager/types" | ||||
| 	"github.com/prometheus/common/model" | ||||
| ) | ||||
| 
 | ||||
| type PostableAlert struct { | ||||
| 	models.PostableAlert | ||||
| 
 | ||||
| 	// List of receiver names to sent alert to
 | ||||
| 	Receivers []string `json:"receivers"` | ||||
| } | ||||
| 
 | ||||
| type AlertProvider struct { | ||||
| 	provider.Alerts | ||||
| 	logger log.Logger | ||||
| 
 | ||||
| 	// TODO(codesome): This stage is temporary to get code out quickly.
 | ||||
| 	// Eventually, the alerts meant directly for receivers and not routing
 | ||||
| 	// will be stored in memory and provided via an iterator, for example
 | ||||
| 	// GetPendingLegacy() AlertIterator, and the external code will use this
 | ||||
| 	// iterator to send to the stage.
 | ||||
| 	stage notify.Stage | ||||
| } | ||||
| 
 | ||||
| func NewAlertProvider(s notify.Stage, m types.Marker, l log.Logger) (*AlertProvider, error) { | ||||
| 	alerts, err := mem.NewAlerts(context.Background(), m, 30*time.Minute, l) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 
 | ||||
| 	return &AlertProvider{ | ||||
| 		Alerts: alerts, | ||||
| 		stage:  s, | ||||
| 		logger: l, | ||||
| 	}, nil | ||||
| } | ||||
| 
 | ||||
| func (ap *AlertProvider) PutPostableAlert(alerts ...*PostableAlert) error { | ||||
| 	var alertsWithReceivers []*PostableAlert | ||||
| 	var alertsWithoutReceivers []*types.Alert | ||||
| 	for _, a := range alerts { | ||||
| 		if len(a.Receivers) > 0 { | ||||
| 			alertsWithReceivers = append(alertsWithReceivers, a) | ||||
| 		} else { | ||||
| 			alertsWithoutReceivers = append(alertsWithoutReceivers, alertForDelivery(a)) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// Without receiver names, alerts go through routing.
 | ||||
| 	if err := ap.Alerts.Put(alertsWithoutReceivers...); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 
 | ||||
| 	if len(alertsWithReceivers) == 0 { | ||||
| 		return nil | ||||
| 	} | ||||
| 
 | ||||
| 	// Group alerts with receivers based on the receiver names.
 | ||||
| 	groupedAlerts := make(map[string][]*types.Alert) | ||||
| 	for _, a := range alertsWithReceivers { | ||||
| 		for _, recv := range a.Receivers { | ||||
| 			groupedAlerts[recv] = append(groupedAlerts[recv], alertForDelivery(a)) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	for recv, alerts := range groupedAlerts { | ||||
| 		ctx := notify.WithReceiverName(context.Background(), recv) | ||||
| 		_, _, err := ap.stage.Exec(ctx, ap.logger, alerts...) | ||||
| 		if err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| func alertForDelivery(a *PostableAlert) *types.Alert { | ||||
| 	lbls := model.LabelSet{} | ||||
| 	annotations := model.LabelSet{} | ||||
| 	for k, v := range a.Labels { | ||||
| 		lbls[model.LabelName(k)] = model.LabelValue(v) | ||||
| 	} | ||||
| 	for k, v := range a.Annotations { | ||||
| 		annotations[model.LabelName(k)] = model.LabelValue(v) | ||||
| 	} | ||||
| 
 | ||||
| 	return &types.Alert{ | ||||
| 		Alert: model.Alert{ | ||||
| 			Labels:       lbls, | ||||
| 			Annotations:  annotations, | ||||
| 			StartsAt:     time.Time(a.StartsAt), | ||||
| 			EndsAt:       time.Time(a.EndsAt), | ||||
| 			GeneratorURL: a.GeneratorURL.String(), | ||||
| 		}, | ||||
| 		UpdatedAt: time.Time{}, // TODO(codesome) what should this be?
 | ||||
| 		Timeout:   false,       // TODO(codesome).
 | ||||
| 	} | ||||
| } | ||||
|  | @ -0,0 +1,129 @@ | |||
| package notifier | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"errors" | ||||
| 	"testing" | ||||
| 
 | ||||
| 	"github.com/go-kit/kit/log" | ||||
| 	"github.com/prometheus/alertmanager/api/v2/models" | ||||
| 	"github.com/prometheus/alertmanager/notify" | ||||
| 	"github.com/prometheus/alertmanager/provider" | ||||
| 	"github.com/prometheus/alertmanager/types" | ||||
| 	"github.com/prometheus/client_golang/prometheus" | ||||
| 	"github.com/prometheus/common/model" | ||||
| 	"github.com/stretchr/testify/require" | ||||
| ) | ||||
| 
 | ||||
| func TestAlertProvider_PutPostableAlert(t *testing.T) { | ||||
| 	marker := types.NewMarker(prometheus.DefaultRegisterer) | ||||
| 	stage := &mockStage{alerts: make(map[string][]*types.Alert)} | ||||
| 	provider := &mockAlertProvider{} | ||||
| 
 | ||||
| 	ap, err := NewAlertProvider(stage, marker, log.NewNopLogger()) | ||||
| 	require.NoError(t, err) | ||||
| 	ap.Alerts = provider | ||||
| 
 | ||||
| 	postableAlerts := []*PostableAlert{ | ||||
| 		{ | ||||
| 			// Goes through routing since no receiver.
 | ||||
| 			PostableAlert: models.PostableAlert{ | ||||
| 				Annotations: models.LabelSet{"msg": "AlertOne annotation"}, | ||||
| 				Alert: models.Alert{ | ||||
| 					Labels: models.LabelSet{"alertname": "AlertOne"}, | ||||
| 				}, | ||||
| 			}, | ||||
| 		}, { | ||||
| 			// Goes directly through notification pipeling since there is receiver.
 | ||||
| 			PostableAlert: models.PostableAlert{ | ||||
| 				Annotations: models.LabelSet{"msg": "AlertTwo annotation"}, | ||||
| 				Alert: models.Alert{ | ||||
| 					Labels: models.LabelSet{"alertname": "AlertTwo"}, | ||||
| 				}, | ||||
| 			}, | ||||
| 			Receivers: []string{"recv1", "recv2"}, | ||||
| 		}, { | ||||
| 			// Goes directly through notification pipeling since there is receiver.
 | ||||
| 			PostableAlert: models.PostableAlert{ | ||||
| 				Annotations: models.LabelSet{"msg": "AlertThree annotation"}, | ||||
| 				Alert: models.Alert{ | ||||
| 					Labels: models.LabelSet{"alertname": "AlertThree"}, | ||||
| 				}, | ||||
| 			}, | ||||
| 			Receivers: []string{"recv2", "recv3"}, | ||||
| 		}, | ||||
| 	} | ||||
| 
 | ||||
| 	require.NoError(t, ap.PutPostableAlert(postableAlerts...)) | ||||
| 
 | ||||
| 	// Alerts that should be sent for routing.
 | ||||
| 	expProviderAlerts := []*types.Alert{ | ||||
| 		{ | ||||
| 			Alert: model.Alert{ | ||||
| 				Annotations: model.LabelSet{"msg": "AlertOne annotation"}, | ||||
| 				Labels:      model.LabelSet{"alertname": "AlertOne"}, | ||||
| 			}, | ||||
| 		}, | ||||
| 	} | ||||
| 	require.Equal(t, expProviderAlerts, provider.alerts) | ||||
| 
 | ||||
| 	// Alerts that should go directly to the notification pipeline.
 | ||||
| 	expPipelineAlerts := map[string][]*types.Alert{ | ||||
| 		"recv1": { | ||||
| 			{ | ||||
| 				Alert: model.Alert{ | ||||
| 					Annotations: model.LabelSet{"msg": "AlertTwo annotation"}, | ||||
| 					Labels:      model.LabelSet{"alertname": "AlertTwo"}, | ||||
| 				}, | ||||
| 			}, | ||||
| 		}, | ||||
| 		"recv2": { | ||||
| 			{ | ||||
| 				Alert: model.Alert{ | ||||
| 					Annotations: model.LabelSet{"msg": "AlertTwo annotation"}, | ||||
| 					Labels:      model.LabelSet{"alertname": "AlertTwo"}, | ||||
| 				}, | ||||
| 			}, { | ||||
| 				Alert: model.Alert{ | ||||
| 					Annotations: model.LabelSet{"msg": "AlertThree annotation"}, | ||||
| 					Labels:      model.LabelSet{"alertname": "AlertThree"}, | ||||
| 				}, | ||||
| 			}, | ||||
| 		}, | ||||
| 		"recv3": { | ||||
| 			{ | ||||
| 				Alert: model.Alert{ | ||||
| 					Annotations: model.LabelSet{"msg": "AlertThree annotation"}, | ||||
| 					Labels:      model.LabelSet{"alertname": "AlertThree"}, | ||||
| 				}, | ||||
| 			}, | ||||
| 		}, | ||||
| 	} | ||||
| 	require.Equal(t, expPipelineAlerts, stage.alerts) | ||||
| } | ||||
| 
 | ||||
| type mockAlertProvider struct { | ||||
| 	alerts []*types.Alert | ||||
| } | ||||
| 
 | ||||
| func (a *mockAlertProvider) Subscribe() provider.AlertIterator           { return nil } | ||||
| func (a *mockAlertProvider) GetPending() provider.AlertIterator          { return nil } | ||||
| func (a *mockAlertProvider) Get(model.Fingerprint) (*types.Alert, error) { return nil, nil } | ||||
| 
 | ||||
| func (a *mockAlertProvider) Put(alerts ...*types.Alert) error { | ||||
| 	a.alerts = append(a.alerts, alerts...) | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| type mockStage struct { | ||||
| 	alerts map[string][]*types.Alert | ||||
| } | ||||
| 
 | ||||
| func (s *mockStage) Exec(ctx context.Context, _ log.Logger, alerts ...*types.Alert) (context.Context, []*types.Alert, error) { | ||||
| 	recv, ok := notify.ReceiverName(ctx) | ||||
| 	if !ok { | ||||
| 		return ctx, nil, errors.New("receiver name not found") | ||||
| 	} | ||||
| 	s.alerts[recv] = append(s.alerts[recv], alerts...) | ||||
| 	return ctx, nil, nil | ||||
| } | ||||
|  | @ -0,0 +1,275 @@ | |||
| package notifier | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"path/filepath" | ||||
| 	"sort" | ||||
| 	"sync" | ||||
| 	"time" | ||||
| 
 | ||||
| 	gokit_log "github.com/go-kit/kit/log" | ||||
| 	"github.com/pkg/errors" | ||||
| 	"github.com/prometheus/alertmanager/config" | ||||
| 	"github.com/prometheus/alertmanager/dispatch" | ||||
| 	"github.com/prometheus/alertmanager/nflog" | ||||
| 	"github.com/prometheus/alertmanager/nflog/nflogpb" | ||||
| 	"github.com/prometheus/alertmanager/notify" | ||||
| 	"github.com/prometheus/alertmanager/pkg/labels" | ||||
| 	"github.com/prometheus/alertmanager/silence" | ||||
| 	"github.com/prometheus/alertmanager/silence/silencepb" | ||||
| 	"github.com/prometheus/alertmanager/types" | ||||
| 	"github.com/prometheus/client_golang/prometheus" | ||||
| 
 | ||||
| 	"github.com/grafana/grafana/pkg/infra/log" | ||||
| 	"github.com/grafana/grafana/pkg/registry" | ||||
| 	"github.com/grafana/grafana/pkg/setting" | ||||
| ) | ||||
| 
 | ||||
| type Alertmanager struct { | ||||
| 	logger log.Logger | ||||
| 
 | ||||
| 	// notificationLog keeps tracks of which notifications we've fired already.
 | ||||
| 	notificationLog *nflog.Log | ||||
| 	// silences keeps the track of which notifications we should not fire due to user configuration.
 | ||||
| 	silences   *silence.Silences | ||||
| 	marker     types.Marker | ||||
| 	alerts     *AlertProvider | ||||
| 	dispatcher *dispatch.Dispatcher | ||||
| 
 | ||||
| 	wg sync.WaitGroup | ||||
| } | ||||
| 
 | ||||
| type WithReceiverStage struct { | ||||
| } | ||||
| 
 | ||||
| func (s *WithReceiverStage) Exec(ctx context.Context, l gokit_log.Logger, alerts ...*types.Alert) (context.Context, []*types.Alert, error) { | ||||
| 	//TODO: Alerts with a receiver should be handled here.
 | ||||
| 	return ctx, nil, nil | ||||
| } | ||||
| 
 | ||||
| func init() { | ||||
| 	registry.RegisterService(&Alertmanager{}) | ||||
| } | ||||
| 
 | ||||
| func (am *Alertmanager) IsDisabled() bool { | ||||
| 	return !setting.AlertingEnabled || !setting.ExecuteAlerts | ||||
| } | ||||
| 
 | ||||
| func (am *Alertmanager) Init() error { | ||||
| 	am.logger = log.New("alertmanager") | ||||
| 
 | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| func (am *Alertmanager) Run(ctx context.Context) error { | ||||
| 	//TODO: Speak with David Parrot wrt to the marker, we'll probably need our own.
 | ||||
| 	am.marker = types.NewMarker(prometheus.DefaultRegisterer) | ||||
| 
 | ||||
| 	var err error | ||||
| 	am.alerts, err = NewAlertProvider(&WithReceiverStage{}, am.marker, gokit_log.NewNopLogger()) | ||||
| 	if err != nil { | ||||
| 		return errors.Wrap(err, "failed to initialize alerting storage component") | ||||
| 	} | ||||
| 
 | ||||
| 	am.silences, err = silence.New(silence.Options{ | ||||
| 		SnapshotFile: filepath.Join("dir", "silences"), //TODO: This is a setting
 | ||||
| 		Retention:    time.Hour * 24,                   //TODO: This is also a setting
 | ||||
| 	}) | ||||
| 	if err != nil { | ||||
| 		return errors.Wrap(err, "unable to initialize the silencing component of alerting") | ||||
| 	} | ||||
| 
 | ||||
| 	am.notificationLog, err = nflog.New( | ||||
| 		nflog.WithRetention(time.Hour*24),                         //TODO: This is a setting.
 | ||||
| 		nflog.WithSnapshot(filepath.Join("dir", "notifications")), //TODO: This should be a setting
 | ||||
| 	) | ||||
| 	if err != nil { | ||||
| 		return errors.Wrap(err, "unable to initialize the notification log component of alerting") | ||||
| 	} | ||||
| 
 | ||||
| 	{ | ||||
| 		// Now, let's put together our notification pipeline
 | ||||
| 		receivers := buildIntegrationsMap() | ||||
| 		routingStage := make(notify.RoutingStage, len(receivers)) | ||||
| 
 | ||||
| 		silencingStage := notify.NewMuteStage(silence.NewSilencer(am.silences, am.marker, gokit_log.NewNopLogger())) | ||||
| 		//TODO: We need to unify these receivers
 | ||||
| 		for name := range receivers { | ||||
| 			stage := createReceiverStage(name, receivers[name], waitFunc, am.notificationLog) | ||||
| 			routingStage[name] = notify.MultiStage{silencingStage, stage} | ||||
| 		} | ||||
| 		am.dispatcher = dispatch.NewDispatcher(am.alerts, BuildRoutingConfiguration(), routingStage, am.marker, timeoutFunc, gokit_log.NewNopLogger(), nil) | ||||
| 	} | ||||
| 
 | ||||
| 	am.wg.Add(1) | ||||
| 	go am.dispatcher.Run() | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // CreateAlerts receives the alerts and then sends them through the corresponding route based on whenever the alert has a receiver embedded or not
 | ||||
| func (am *Alertmanager) CreateAlerts(alerts ...*PostableAlert) error { | ||||
| 	return am.alerts.PutPostableAlert(alerts...) | ||||
| } | ||||
| 
 | ||||
| func (am *Alertmanager) ListSilences(matchers []*labels.Matcher) ([]types.Silence, error) { | ||||
| 	pbsilences, _, err := am.silences.Query() | ||||
| 	if err != nil { | ||||
| 		return nil, errors.Wrap(err, "unable to query for the list of silences") | ||||
| 	} | ||||
| 	r := []types.Silence{} | ||||
| 	for _, pbs := range pbsilences { | ||||
| 		s, err := silenceFromProto(pbs) | ||||
| 		if err != nil { | ||||
| 			return nil, errors.Wrap(err, "unable to marshal silence") | ||||
| 		} | ||||
| 
 | ||||
| 		sms := make(map[string]string) | ||||
| 		for _, m := range s.Matchers { | ||||
| 			sms[m.Name] = m.Value | ||||
| 		} | ||||
| 
 | ||||
| 		if !matchFilterLabels(matchers, sms) { | ||||
| 			continue | ||||
| 		} | ||||
| 
 | ||||
| 		r = append(r, *s) | ||||
| 	} | ||||
| 
 | ||||
| 	var active, pending, expired []types.Silence | ||||
| 	for _, s := range r { | ||||
| 		switch s.Status.State { | ||||
| 		case types.SilenceStateActive: | ||||
| 			active = append(active, s) | ||||
| 		case types.SilenceStatePending: | ||||
| 			pending = append(pending, s) | ||||
| 		case types.SilenceStateExpired: | ||||
| 			expired = append(expired, s) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	sort.Slice(active, func(i int, j int) bool { | ||||
| 		return active[i].EndsAt.Before(active[j].EndsAt) | ||||
| 	}) | ||||
| 	sort.Slice(pending, func(i int, j int) bool { | ||||
| 		return pending[i].StartsAt.Before(pending[j].EndsAt) | ||||
| 	}) | ||||
| 	sort.Slice(expired, func(i int, j int) bool { | ||||
| 		return expired[i].EndsAt.After(expired[j].EndsAt) | ||||
| 	}) | ||||
| 
 | ||||
| 	// Initialize silences explicitly to an empty list (instead of nil)
 | ||||
| 	// So that it does not get converted to "null" in JSON.
 | ||||
| 	silences := []types.Silence{} | ||||
| 	silences = append(silences, active...) | ||||
| 	silences = append(silences, pending...) | ||||
| 	silences = append(silences, expired...) | ||||
| 
 | ||||
| 	return silences, nil | ||||
| } | ||||
| 
 | ||||
| func (am *Alertmanager) GetSilence(silence *types.Silence)    {} | ||||
| func (am *Alertmanager) CreateSilence(silence *types.Silence) {} | ||||
| func (am *Alertmanager) DeleteSilence(silence *types.Silence) {} | ||||
| 
 | ||||
| // createReceiverStage creates a pipeline of stages for a receiver.
 | ||||
| func createReceiverStage(name string, integrations []notify.Integration, wait func() time.Duration, notificationLog notify.NotificationLog) notify.Stage { | ||||
| 	var fs notify.FanoutStage | ||||
| 	for i := range integrations { | ||||
| 		recv := &nflogpb.Receiver{ | ||||
| 			GroupName:   name, | ||||
| 			Integration: integrations[i].Name(), | ||||
| 			Idx:         uint32(integrations[i].Index()), | ||||
| 		} | ||||
| 		var s notify.MultiStage | ||||
| 		s = append(s, notify.NewWaitStage(wait)) | ||||
| 		s = append(s, notify.NewDedupStage(&integrations[i], notificationLog, recv)) | ||||
| 		//TODO: This probably won't work w/o the metrics
 | ||||
| 		s = append(s, notify.NewRetryStage(integrations[i], name, nil)) | ||||
| 		s = append(s, notify.NewSetNotifiesStage(notificationLog, recv)) | ||||
| 
 | ||||
| 		fs = append(fs, s) | ||||
| 	} | ||||
| 	return fs | ||||
| } | ||||
| 
 | ||||
| // BuildRoutingConfiguration produces an alertmanager-based routing configuration.
 | ||||
| func BuildRoutingConfiguration() *dispatch.Route { | ||||
| 	var cfg *config.Config | ||||
| 	return dispatch.NewRoute(cfg.Route, nil) | ||||
| } | ||||
| 
 | ||||
| func buildIntegrationsMap() map[string][]notify.Integration { | ||||
| 	return map[string][]notify.Integration{} | ||||
| } | ||||
| 
 | ||||
| func waitFunc() time.Duration { | ||||
| 	return setting.AlertingNotificationTimeout | ||||
| } | ||||
| 
 | ||||
| func timeoutFunc(d time.Duration) time.Duration { | ||||
| 	//TODO: What does MinTimeout means here?
 | ||||
| 	if d < notify.MinTimeout { | ||||
| 		d = notify.MinTimeout | ||||
| 	} | ||||
| 	return d + waitFunc() | ||||
| } | ||||
| 
 | ||||
| // copied from the Alertmanager
 | ||||
| func silenceFromProto(s *silencepb.Silence) (*types.Silence, error) { | ||||
| 	sil := &types.Silence{ | ||||
| 		ID:        s.Id, | ||||
| 		StartsAt:  s.StartsAt, | ||||
| 		EndsAt:    s.EndsAt, | ||||
| 		UpdatedAt: s.UpdatedAt, | ||||
| 		Status: types.SilenceStatus{ | ||||
| 			State: types.CalcSilenceState(s.StartsAt, s.EndsAt), | ||||
| 		}, | ||||
| 		Comment:   s.Comment, | ||||
| 		CreatedBy: s.CreatedBy, | ||||
| 	} | ||||
| 	for _, m := range s.Matchers { | ||||
| 		var t labels.MatchType | ||||
| 		switch m.Type { | ||||
| 		case silencepb.Matcher_EQUAL: | ||||
| 			t = labels.MatchEqual | ||||
| 		case silencepb.Matcher_REGEXP: | ||||
| 			t = labels.MatchRegexp | ||||
| 		case silencepb.Matcher_NOT_EQUAL: | ||||
| 			t = labels.MatchNotEqual | ||||
| 		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) | ||||
| 	} | ||||
| 
 | ||||
| 	return sil, nil | ||||
| } | ||||
| 
 | ||||
| func matchFilterLabels(matchers []*labels.Matcher, sms map[string]string) bool { | ||||
| 	for _, m := range matchers { | ||||
| 		v, prs := sms[m.Name] | ||||
| 		switch m.Type { | ||||
| 		case labels.MatchNotRegexp, labels.MatchNotEqual: | ||||
| 			if m.Value == "" && prs { | ||||
| 				continue | ||||
| 			} | ||||
| 			if !m.Matches(v) { | ||||
| 				return false | ||||
| 			} | ||||
| 		default: | ||||
| 			if m.Value == "" && !prs { | ||||
| 				continue | ||||
| 			} | ||||
| 			if !m.Matches(v) { | ||||
| 				return false | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return true | ||||
| } | ||||
|  | @ -0,0 +1 @@ | |||
| package notifier | ||||
		Loading…
	
		Reference in New Issue