Commit Graph

3316 Commits

Author SHA1 Message Date
George Robinson d31a249ffc
#3513: Add GroupMarker interface (#3792)
* Add GroupMarker interface

This commit adds a new GroupMarker interface that marks the status
of groups. For example, whether an alert is muted because or one
or more active or mute time intervals.

It renames the existing Marker interface to AlertMarker to avoid
confusion.

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-04-30 15:26:04 +01:00
George Robinson dacbf0050b
#3513: TimeMuter returns the names of time intervals (#3791)
* TimeMuter returns the names of time intervals

This commit updates the TimeMuter interface to also return the names
of the time intervals that muted the alerts.

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-04-30 12:47:00 +01:00
Gokhan a9b5cb4351
Enable setting ThreadId for Telegram notifications (#3638)
* Enable setting ThreadId for telegram notifications

Signed-off-by: Gokhan Sari <gokhan@sari.m

---------
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2024-04-30 11:12:58 +01:00
Simon Pasquier 7aa3cde1af
Merge pull request #3783 from prometheus/dependabot/go_modules/github.com/go-openapi/strfmt-0.23.0
Bump github.com/go-openapi/strfmt from 0.22.0 to 0.23.0
2024-04-29 14:39:45 +02:00
dependabot[bot] 25e5627d46
Bump github.com/go-openapi/strfmt from 0.22.0 to 0.23.0
Bumps [github.com/go-openapi/strfmt](https://github.com/go-openapi/strfmt) from 0.22.0 to 0.23.0.
- [Commits](https://github.com/go-openapi/strfmt/compare/v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: github.com/go-openapi/strfmt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 12:29:11 +00:00
Simon Pasquier 99c31a677d
Merge pull request #3818 from prometheus/dependabot/go_modules/golang.org/x/tools-0.20.0
Bump golang.org/x/tools from 0.17.0 to 0.20.0
2024-04-29 14:28:34 +02:00
Simon Pasquier 26e58c680a
Merge pull request #3784 from prometheus/dependabot/go_modules/github.com/aws/aws-sdk-go-1.51.11
Bump github.com/aws/aws-sdk-go from 1.50.29 to 1.51.11
2024-04-29 14:27:54 +02:00
Simon Pasquier e7b9381b2e
Merge pull request #3782 from prometheus/dependabot/go_modules/github.com/hashicorp/memberlist-0.5.1
Bump github.com/hashicorp/memberlist from 0.5.0 to 0.5.1
2024-04-29 14:27:18 +02:00
youngwendy 72b62dbfea
chore: remove repetitive words (#3804)
Signed-off-by: youngwendy <clonefetch@outlook.com>
2024-04-25 18:54:53 +02:00
dependabot[bot] 09ff9a5c1c
Bump golang.org/x/tools from 0.17.0 to 0.20.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.17.0 to 0.20.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.17.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-25 16:39:48 +00:00
dependabot[bot] 52f6c12b99
Bump github.com/hashicorp/memberlist from 0.5.0 to 0.5.1
Bumps [github.com/hashicorp/memberlist](https://github.com/hashicorp/memberlist) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/hashicorp/memberlist/releases)
- [Commits](https://github.com/hashicorp/memberlist/compare/v0.5.0...v0.5.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/memberlist
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-25 16:39:34 +00:00
Holger Freyther 530bb3f6b3
ui: Force using linux/amd64 when using docker (#3807)
The elm npm package doesn't support linux/arm64. The easiest option
is to force docker to run this as a AMD64 container.

Upstream issue:
https://github.com/elm/compiler/issues/2283

Signed-off-by: Holger Hans Peter Freyther <holger@freyther.de>
2024-04-25 17:39:05 +01:00
Holger Freyther 5b99b12aca
dep: Manually upgrade golang.org/x/net (#3674) (#3811)
Addresses:
Scanning your code and 410 packages across 83 dependent modules for known vulnerabilities...

=== Symbol Results ===

Vulnerability #1: GO-2024-2687
    HTTP/2 CONTINUATION flood in net/http
  More info: https://pkg.go.dev/vuln/GO-2024-2687
  Module: golang.org/x/net
    Found in: golang.org/x/net@v0.20.0
    Fixed in: golang.org/x/net@v0.23.0
    Example traces found:
      #1: cli/root.go:122:52: cli.NewAlertmanagerClient calls config.NewClientFromConfig, which eventually calls http2.ConfigureTransports
      #2: types/types.go:290:28: types.MultiError.Error calls http2.ConnectionError.Error
      #3: notify/notify.go:998:21: notify.TimeActiveStage.Exec calls log.jsonLogger.Log, which eventually calls http2.ErrCode.String
      #4: notify/notify.go:998:21: notify.TimeActiveStage.Exec calls log.jsonLogger.Log, which eventually calls http2.FrameHeader.String
      #5: notify/notify.go:998:21: notify.TimeActiveStage.Exec calls log.jsonLogger.Log, which eventually calls http2.FrameType.String
      #6: types/types.go:290:28: types.MultiError.Error calls http2.GoAwayError.Error
      #7: notify/notify.go:998:21: notify.TimeActiveStage.Exec calls log.jsonLogger.Log, which eventually calls http2.Setting.String
      #8: notify/notify.go:998:21: notify.TimeActiveStage.Exec calls log.jsonLogger.Log, which eventually calls http2.SettingID.String
      #9: types/types.go:290:28: types.MultiError.Error calls http2.StreamError.Error
      #10: api/v2/client/silence/silence_client.go:196:35: silence.Client.PostSilences calls client.Runtime.Submit, which eventually calls http2.Transport.NewClientConn
      #11: api/v2/client/silence/silence_client.go:196:35: silence.Client.PostSilences calls client.Runtime.Submit, which eventually calls http2.Transport.RoundTrip
      #12: notify/email/email.go:253:14: email.Email.Notify calls fmt.Fprintf, which eventually calls http2.chunkWriter.Write
      #13: types/types.go:290:28: types.MultiError.Error calls http2.connError.Error
      #14: types/types.go:290:28: types.MultiError.Error calls http2.duplicatePseudoHeaderError.Error
      #15: test/cli/acceptance.go:362:3: cli.Alertmanager.Start calls http2.gzipReader.Close
      #16: test/cli/acceptance.go:366:22: cli.Alertmanager.Start calls io.ReadAll, which calls http2.gzipReader.Read
      #17: types/types.go:290:28: types.MultiError.Error calls http2.headerFieldNameError.Error
      #18: types/types.go:290:28: types.MultiError.Error calls http2.headerFieldValueError.Error
      #19: api/v2/client/silence/silence_client.go:196:35: silence.Client.PostSilences calls client.Runtime.Submit, which eventually calls http2.noDialH2RoundTripper.RoundTrip
      #20: types/types.go:290:28: types.MultiError.Error calls http2.pseudoHeaderError.Error
      #21: notify/email/email.go:253:14: email.Email.Notify calls fmt.Fprintf, which eventually calls http2.stickyErrWriter.Write
      #22: test/cli/acceptance.go:362:3: cli.Alertmanager.Start calls http2.transportResponseBody.Close
      #23: test/cli/acceptance.go:366:22: cli.Alertmanager.Start calls io.ReadAll, which calls http2.transportResponseBody.Read
      #24: notify/notify.go:998:21: notify.TimeActiveStage.Exec calls log.jsonLogger.Log, which eventually calls http2.writeData.String

Your code is affected by 1 vulnerability from 1 module.
This scan also found 0 vulnerabilities in packages you import and 2
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.

Signed-off-by: Holger Hans Peter Freyther <holger@freyther.de>
2024-04-25 17:38:44 +01:00
George Robinson 7106bcc1ab
Fix version in APIv1 deprecation notice (#3815)
Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-04-23 16:16:01 +01:00
George Robinson dc1e1a2b88
Add date and tz functions to templates (#3812)
* Add date and tz functions to templates

This commit adds the date and tz functions to templates. This means
users can now format time in a specified format and also change
the timezone to their specific locale.

An example of how these functions work, and can be composed together,
can be seen here:

	{{ .StartsAt | tz "Europe/Paris" | date "15:04:05 MST" }}

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-04-22 16:15:33 +02:00
Holger Freyther cb9724db47
notify/webhook: Fix crash on errors when url_file is used (#3798) (#3800) 2024-04-12 11:28:59 +02:00
George Robinson 036eb508df
Fix `Route.ID()` returns conflicting IDs (#3803)
* Update TestRouteID tests

This commit updates the TestRouteID tests to be more simple without
reducing test coverage. It also adds new cases that show a bug
in the existing code where conflicting IDs can be returned.

Signed-off-by: George Robinson <george.robinson@grafana.com>

* Fix Route.ID() returns conflicting IDs

This commit fixes a bug where Route.ID() returns conflicting IDs.
For example, the configuration:

    receiver: test
    routes:
    - matchers:
        - foo=bar
      continue: true
      routes:
      - matchers:
        - bar=baz
    - matchers:
        - foo=bar
      continue: true
      routes:
      - matchers:
        - bar=baz

Gives the following Route IDs:

    {}
    {}/{foo="bar"}/0
    {}/{foo="bar"}/{bar="baz"}/0
    {}/{foo="bar"}/1
    {}/{foo="bar"}/{bar="baz"}/0

When it should give these Route IDs:

    {}
    {}/{foo="bar"}/0
    {}/{foo="bar"}/0/{bar="baz"}/0
    {}/{foo="bar"}/1
    {}/{foo="bar"}/1/{bar="baz"}/0

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-04-12 10:40:14 +02:00
George Robinson fc8c7d146f
#3513: Rewrite TestTimeMuteStage tests (#3794) 2024-04-11 13:53:50 +02:00
George Robinson 2dc23c90c9
Rewrite TestTimeActiveStage tests (#3795)
This commit rewrites the existing TestTimeActiveStage unit tests
to have complete isolation between test cases. Before this change,
each test case affected the state of its subsequent tests.

The motivation behind this change is to make it easier to assert
that alerts have been marked as muted.

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-04-11 11:42:16 +02:00
dependabot[bot] 688d6490b4
Bump use-query-params from 2.2.0 to 2.2.1 in /ui/react-app
Bumps [use-query-params](https://github.com/pbeshai/use-query-params) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/pbeshai/use-query-params/releases)
- [Commits](https://github.com/pbeshai/use-query-params/compare/use-query-params@2.2.0...use-query-params@2.2.1)

---
updated-dependencies:
- dependency-name: use-query-params
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 15:38:38 +00:00
dependabot[bot] b2fd7592a2
Bump github.com/aws/aws-sdk-go from 1.50.29 to 1.51.11
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.50.29 to 1.51.11.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.50.29...v1.51.11)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 15:31:09 +00:00
George Robinson 14cbe6301c
Add more benchmarks for inhibition rules (#3773)
* Add more benchmarks for inhibition rules

This commit adds more benchmarks for inhibition rules where
just the last rule in the benchmark inhibits the labels.

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-03-22 09:07:19 +00:00
George Robinson f41fccb730
Inhibition Rules: Add benchmarks for Mutes (#3772)
* Add benchmarks for Mutes

This commit adds benchmarks for Mutes in the inhibit package.

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-03-21 20:58:48 +00:00
George Robinson 6c70b5c014
Silences: Add benchmarks for Mutes (#3771)
* Add benchmarks for Mutes

This commit updates the existing benchmarks for silences to also
benchmark Mutes. This complements the existing Query benchmarks
by also measuring the time taken to mark silenced alerts.

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-03-21 20:54:56 +00:00
George Robinson 342f6a599c
Add godot linter (#3613)
* Add godot linter

Signed-off-by: George Robinson <george.robinson@grafana.com>

* Remove extra line from LICENSE

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-03-21 11:26:46 +00:00
dependabot[bot] 85d1e06d24
Bump webpack from 5.75.0 to 5.76.0 in /ui/react-app
Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-19 13:58:59 +00:00
Christoph Maser f82574a376
docs: better descibe `email_config.to` fromat (#3760)
Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
2024-03-14 12:56:31 +00:00
dependabot[bot] 54af8b59ab
Bump webpack-merge from 5.8.0 to 5.10.0 in /ui/react-app (#3751)
Bumps [webpack-merge](https://github.com/survivejs/webpack-merge) from 5.8.0 to 5.10.0.
- [Changelog](https://github.com/survivejs/webpack-merge/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/survivejs/webpack-merge/compare/v5.8.0...v5.10.0)

---
updated-dependencies:
- dependency-name: webpack-merge
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 12:45:57 +00:00
dependabot[bot] 4b6b3596b4
Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 (#3750)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.19.0/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 12:45:22 +00:00
dependabot[bot] 761edc9ebe
Bump github.com/aws/aws-sdk-go from 1.50.8 to 1.50.29 (#3748)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.50.8 to 1.50.29.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.50.8...v1.50.29)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 12:44:45 +00:00
dependabot[bot] abb5abdcdc
Bump @types/react-dom from 18.0.11 to 18.2.19 in /ui/react-app (#3753)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 18.0.11 to 18.2.19.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 12:44:32 +00:00
dependabot[bot] 9edea05c12
Bump mdi-material-ui from 7.6.0 to 7.8.0 in /ui/react-app (#3754)
Bumps [mdi-material-ui](https://github.com/TeamWertarbyte/mdi-material-ui) from 7.6.0 to 7.8.0.
- [Release notes](https://github.com/TeamWertarbyte/mdi-material-ui/releases)
- [Commits](https://github.com/TeamWertarbyte/mdi-material-ui/compare/v7.6.0...v7.8.0)

---
updated-dependencies:
- dependency-name: mdi-material-ui
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 12:44:21 +00:00
Anand Rajagopal 680568b518
Send a slice of values to callback function instead of references (#3745) 2024-03-10 17:40:58 +00:00
Anand Rajagopal 1eb83c21eb
A small fix to avoid deadlock that can happen as mentioned in issue #3682 (#3715)
Signed-off-by: Anand Rajagopal <anrajag@amazon.com>
2024-03-01 09:39:01 +00:00
George Krajcsovits d85bef20d9
feature: add native histogram support to latency metrics (#3737)
Note that this does not stop showing classic metrics, for now
it is up to the scrape config to decide whether to keep those instead or
both.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-02-29 14:53:47 +00:00
George Robinson d1fe4b7f6f
Fix code blocks in the docs being blockquoted instead (#3744)
Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-02-29 09:57:56 +00:00
gotjosh 89e7f00df3
Cut 0.27 main (#3742)
* Cut Alertmanager version 0.27 from the rc.0 (#3740)

Signed-off-by: gotjosh <josue.abreu@gmail.com>

* update the release md to reflect the current timings

Signed-off-by: gotjosh <josue.abreu@gmail.com>

---------

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2024-02-28 14:53:13 +00:00
Philipp Stehle 81c3e3bae5
`amtool template render` improve default data (#3725)
Signed-off-by: Philipp Stehle <anderschwiedu@gmail.com>
2024-02-28 11:10:25 +00:00
prombot 0d42a12c9a Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-02-26 17:47:55 +00:00
Mathieu Parent ef5e903418 Support default SMTP TLS config
Fixes: #3709

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
2024-02-22 16:02:19 +01:00
Luca Kröger efa801faf7
fix discord & msteams webhook url configuration (#3728)
Signed-off-by: Luca Kröger <l.kroeger01@gmail.com>
2024-02-19 16:53:59 +00:00
gotjosh 80b3cb072f
Notify: Several improvements around the `suppressed_total` metric and logs for muting. (#3723) 2024-02-15 11:12:58 +00:00
gotjosh b7d4c4ab86
Release: Cut 0.27.0-rc.0 (#3721)
* Release: Cut 0.27.0-rc.0

Signed-off-by: gotjosh <josue.abreu@gmail.com>

* small fixes

- typo in respond
- add PR numbers for UTF-8

Signed-off-by: gotjosh <josue.abreu@gmail.com>

* more worthsmithing

Signed-off-by: gotjosh <josue.abreu@gmail.com>

* Fix flaky test TestClusterJoinAndReconnect/TestTLSConnection (#3722)

wait until `p2.Status()` returns because it blocks until we're ready - that way, we're guaranteed to know that the cluster size is 2.

Signed-off-by: gotjosh <josue.abreu@gmail.com>

---------

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2024-02-14 11:27:10 +00:00
gotjosh d352d16e27
Fix flaky test TestClusterJoinAndReconnect/TestTLSConnection (#3722)
wait until `p2.Status()` returns because it blocks until we're ready - that way, we're guaranteed to know that the cluster size is 2.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2024-02-14 11:18:28 +00:00
George Robinson c2cf3db045
Support UTF-8 label matchers: Update the docs on how to use UTF-8 in label matchers and parse mode feature flags (#3572)
* Update the docs on how to use UTF-8 in label matchers and parse mode feature flags

Signed-off-by: George Robinson <george.robinson@grafana.com>
---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-02-14 09:20:42 +00:00
George Robinson 4d6ddd25c9
Fix panic in acceptance tests (#3592)
* Fix panic in acceptance tests

This commit attempts to address a panic that occurs in acceptance
tests if a server in the cluster fails to start.

Signed-off-by: George Robinson <george.robinson@grafana.com>

* Remove started and check am.cmd.Process != nil

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-02-13 15:38:44 +00:00
George Robinson 604d442f30
Fix log line in featurecontrol (#3719)
This commit fixes a log line in the featurecontrol package which
should be "UTF-8 strict mode" and not "UTF-8 mode".

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-02-13 14:35:03 +00:00
Lucas Burigo 2fd1b52c98
Update notification_examples.md (#3707)
Signed-off-by: Lucas Burigo <burigolucas@users.noreply.github.com>
2024-02-13 12:40:46 +00:00
George Robinson 44d5f70c3b
Fix a small number of inconsistencies in compat package logging (#3718)
This commit fixes a small number of inconsistencies in the compat
package logging. It now has consistent use of classic matchers
parser and UTF-8 matchers parser, instead of old matchers parser
and new matchers parser.

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-02-13 11:37:42 +00:00
TJ Hoplock f00025d037
feat: add counter to track alerts dropped outside of time_intervals (#3565)
* feat: add counter to track alerts dropped outside of time_intervals

Addresses: #3512

This adds a new counter metric `alertmanager_alerts_supressed_total`
that is incremented by `len(alerts)` when an alert is suppressed for
being outside of a time_interval, ie inside of a mute_time_intervals or
outside of an active_time_intervals.

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* test: add time interval suppression metric checks for notify

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* test: fix failure message log values in notifier

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* ref: address PR feedback for #3565

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* fix: track suppressed notifications metric for inhibit/silence

Based on PR feedback:

https://github.com/prometheus/alertmanager/pull/3565/files#r1393068026

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* fix: broken notifier tests

- fixed metric count check to properly check the diff between
  input/output notifications from the suppression to compare to suppression
metric, was previously inverted to compare to how many notifications it
suppressed.
- stopped using `Reset()` to compare collection counts between the
  multiple stages that are executed in `TestMuteStageWithSilences()`.
the intent was to compare a clean metric collection after each stage
execution, but the final stage where all silences are lifted results in
no metric being created in the test, causing `prom_testutil.ToFloat64()`
to panic. changed to separate vars to check counts between each stage,
with care to consider prior counts.

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* rename metric and add constants

Signed-off-by: gotjosh <josue.abreu@gmail.com>

---------

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Co-authored-by: gotjosh <josue.abreu@gmail.com>
2024-02-13 11:17:24 +00:00