Commit Graph

2984 Commits

Author SHA1 Message Date
George Robinson
ca5089d33e
Support UTF-8 label matchers: Rename feature flags and make package public ()
* Rename feature flags and make package public

This commit renames the feature flags "classic-matchers-parsing"
and "utf8-matchers-parsing" to "classic-matchers" and "utf8-matchers".
This better represents their use, for example, when validating
both alerts and silences created via the API.

It also makes the feature flags package public for two reasons:

1. AllowedFlags is a public variable
2. We would rather use these consts in Mimir then have to hardcode
   the strings ourselves, and be subject to breaking changes in future

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

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-11-17 20:07:54 +00:00
Tomas Kozak
d2b6692f2c
Reflect Discord's max length message limits ()
* Reflect Discord's max length message limits

Signed-off-by: Tomas Kozak <kozak@talko.cz>

* Fix log key name

Signed-off-by: Tomas Kozak <kozak@talko.cz>

---------

Signed-off-by: Tomas Kozak <kozak@talko.cz>
2023-11-15 07:37:47 +00:00
George Robinson
9dbc8b6b91
Support UTF-8 label matchers: Update Stringer for non-Prometheus compliant label names ()
* Update Stringer for non-Prometheus compliant label names

This commit updates the String method to print non-Prometheus
compliant label names in a format that can be parsed in the
UTF-8 parser. Such inputs are never valid in the classic parser.
If the label name is Prometheus compliant, it is still printed
unquoted.

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

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-11-14 16:25:13 +00:00
Simon Pasquier
716830a56f
Merge pull request from cr7258/fix-label-mismatch
fix: label mismatch for alertmanager_notifications_failed_total
2023-11-14 11:39:36 +01:00
George Robinson
f96ba1b58f
unquote should check for invalid UTF-8 code points ()
Quoted tokens can contain both UTF-8 byte and code point literals
that should be interpreted when quoted. However, we need to check
that the interpreted literals are valid UTF-8 code points or not.
This now happens in unquote.

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-11-13 16:31:15 +00:00
chengzw
aff09c28dc fix label mismatch for alertmanager_notifications_failed_total
Signed-off-by: chengzw <chengzw258@163.com>
2023-11-11 22:26:38 +08:00
George Robinson
ce6efba023
Update go.mod to require Go 1.21 ()
* Update circleci/go to 1.9.0

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-11-06 14:16:57 +01:00
Alexander Weaver
fdea7e731c
Isolate react-app package ()
* Isolate react-app package

Signed-off-by: Alex Weaver <weaver.alex.d@gmail.com>

---------

Signed-off-by: Alex Weaver <weaver.alex.d@gmail.com>
2023-11-03 14:50:06 +00:00
Simon Pasquier
861c3d87c7
Merge pull request from prometheus/dependabot/go_modules/golang.org/x/tools-0.14.0
Bump golang.org/x/tools from 0.13.0 to 0.14.0
2023-11-02 15:02:06 +01:00
dependabot[bot]
2ffdc95721
Bump golang.org/x/tools from 0.13.0 to 0.14.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.13.0...v0.14.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>
2023-11-02 13:45:48 +00:00
Simon Pasquier
0e02f89688
Merge pull request from prometheus/dependabot/go_modules/github.com/aws/aws-sdk-go-1.47.0
Bump github.com/aws/aws-sdk-go from 1.44.317 to 1.47.0
2023-11-02 14:44:28 +01:00
Simon Pasquier
55ab6d2894
Merge pull request from prometheus/dependabot/go_modules/github.com/go-openapi/swag-0.22.4
Bump github.com/go-openapi/swag from 0.22.3 to 0.22.4
2023-11-02 14:39:38 +01:00
Simon Pasquier
9fcdc1b80c
Merge pull request from prometheus/dependabot/go_modules/github.com/hashicorp/golang-lru/v2-2.0.7
Bump github.com/hashicorp/golang-lru/v2 from 2.0.2 to 2.0.7
2023-11-02 14:37:39 +01:00
dependabot[bot]
c4cd73c3b6
Bump github.com/go-openapi/swag from 0.22.3 to 0.22.4
Bumps [github.com/go-openapi/swag](https://github.com/go-openapi/swag) from 0.22.3 to 0.22.4.
- [Commits](https://github.com/go-openapi/swag/compare/v0.22.3...v0.22.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 15:44:36 +00:00
dependabot[bot]
9aa15e667b
Bump github.com/hashicorp/golang-lru/v2 from 2.0.2 to 2.0.7
Bumps [github.com/hashicorp/golang-lru/v2](https://github.com/hashicorp/golang-lru) from 2.0.2 to 2.0.7.
- [Release notes](https://github.com/hashicorp/golang-lru/releases)
- [Commits](https://github.com/hashicorp/golang-lru/compare/v2.0.2...v2.0.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 15:44:32 +00:00
dependabot[bot]
91fa40b2c0
Bump github.com/aws/aws-sdk-go from 1.44.317 to 1.47.0
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.317 to 1.47.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.317...v1.47.0)

---
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>
2023-11-01 15:44:18 +00:00
George Robinson
7cdecbf6ee
Remove braces from suggestion ()
This commit removes the open and close braces from the suggestion
as braces do not make sense in the configuration file. This does
not change the behavior of the suggestion whatsoever as these
are optional.

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-10-30 14:30:19 +00:00
George Robinson
b5b5a1df3d
Support UTF-8 label matchers: Do not allow unquoted escape sequences ()
* Do not allow unquoted escape sequences

This commit updates the matchers parser to reject unquoted
openmetrics escape sequences. As an example, foo=bar\n
will no longer parse, and must instead be written as
foo="bar\n". This avoids an issue where the input is valid
in both the matchers and classic parsers, but results
in two different parsings.

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-10-30 13:56:54 +00:00
George Robinson
8512285e54
Support UTF-8 label matchers: Update compliance tests ()
* Update compliance tests

This commit updates compliance tests to include openmetrics
escape sequences that are not valid in the UTF-8 matchers parser.

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

* Add tests for openmetrics escape sequences

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

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-10-25 09:52:17 +01:00
George Robinson
d2501323d2
Add debug logs for muted alerts ()
This commit adds debug logs to MuteStage that logs when an alert
is muted. This can help operators root cause missing notifications
when alerts are silenced by mistake or purpose but then forgotten
about.

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-10-24 18:00:38 +01:00
Simon Pasquier
280a742b76
Merge pull request from prometheus/bump-go-swagger-to-latest-stable
Bump: go-swagger to latest stable
2023-10-19 17:06:10 +02:00
gotjosh
2ec6b89aa7
Bump: go-swagger to latest stable
Bumps the API spec/client generation util of `go-swagger` from 0.30.2 to 0.30.5 which is the latest stable.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2023-10-19 12:11:29 +01:00
George Robinson
16aa996c4f
Support UTF-8 label matchers: Add compat package with feature flag and use in amtool ()
* Add adapter package for parser feature flag

This commit adds the compat package allowing users to switch
between the new matchers/parse parser and the old pkg/labels parser.
The new matchers/parse parser uses a fallback mechanism where if
the input cannot be parsed in the new parser it then attempts to
use the old parser. If an input is parsed in the old parser but
not the new parser, then a warning log is emitted.

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-10-19 12:00:01 +01:00
Alexander Weaver
412f06255a
Separate and export BuildReceiverIntegrations ()
* Move and export BuildReceiverIntegrations

Signed-off-by: Alex Weaver <weaver.alex.d@gmail.com>

---------

Signed-off-by: Alex Weaver <weaver.alex.d@gmail.com>
2023-10-17 14:45:44 +01:00
George Robinson
98290c3349
Add duration to the notify success message ()
This commit updates Alertmanager to add a duration to the notify
success message. It complements the existing histogram to offer
fine-grained information about notification attempts. This can be
useful when debuggin duplicate notifications, for example, when
the duration exceeds peer_timeout.

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-10-17 09:50:33 +01:00
Simon Pasquier
bdcff29194
Merge pull request from slashpai/cve_fix
fix: Bump golang.org/x/net to v0.17.0
2023-10-17 09:42:12 +02:00
Simon Pasquier
2c14fa3fb3
Merge pull request from prometheus/dependabot/go_modules/github.com/prometheus/client_golang-1.17.0
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
2023-10-17 09:27:49 +02:00
Jayapriya Pai
9e26979dc9
fix: Bump golang.org/x/net to v0.17.0
Address CVE-2023-39325

Signed-off-by: Jayapriya Pai <janantha@redhat.com>
2023-10-17 07:40:37 +05:30
gotjosh
acb58400fd
Refactor: Move inTimeIntervals from notify to timeinterval ()
* Refactor: Move `inTimeIntervals` from `notify` to `timeinterval`

There's absolutely no change of functionality here and I've expanded coverage for similar logic in both places.
---------

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2023-10-13 14:15:05 +01:00
Lukas Hauser
318d2a3abf
Fix Docs: default ()
Signed-off-by: Lukas Hauser <github@luka5.de>
2023-10-12 16:30:32 +01:00
George Robinson
573e2c3694
Update configuration docs for Repeat interval ()
Although it is true that Repeat interval should be greater than or
equal to the Group interval, it should also be a multiple of it too.
If the Repeat interval is not a multiple, then because of how aggregation
groups are flushed, it will be made into one implicitly. This commit
documents this behavior.

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-10-12 16:12:12 +01:00
Jan Fajerski
d7b865d6cc
actions: cross build in ci and fix publish ()
* actions: cross build in ci and fix publish

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* actions: build before release publishing

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

---------

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
2023-10-12 10:43:30 +01:00
Simon Pasquier
e92d29d861
Merge pull request from prometheus/dependabot/go_modules/golang.org/x/tools-0.13.0
Bump golang.org/x/tools from 0.12.0 to 0.13.0
2023-10-02 10:21:22 +02:00
dependabot[bot]
c1b5a371ba
Bump golang.org/x/tools from 0.12.0 to 0.13.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.12.0...v0.13.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>
2023-10-02 08:15:18 +00:00
Simon Pasquier
88609d624b
Merge pull request from prometheus/dependabot/go_modules/github.com/rs/cors-1.10.1
Bump github.com/rs/cors from 1.9.0 to 1.10.1
2023-10-02 10:13:41 +02:00
Simon Pasquier
e9c2b0c26d
Merge pull request from prometheus/dependabot/go_modules/golang.org/x/net-0.15.0
Bump golang.org/x/net from 0.14.0 to 0.15.0
2023-10-02 10:12:32 +02:00
dependabot[bot]
641480717a
Bump github.com/rs/cors from 1.9.0 to 1.10.1
Bumps [github.com/rs/cors](https://github.com/rs/cors) from 1.9.0 to 1.10.1.
- [Release notes](https://github.com/rs/cors/releases)
- [Commits](https://github.com/rs/cors/compare/v1.9.0...v1.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 15:13:17 +00:00
dependabot[bot]
1da68ac7cc
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.17.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>
2023-10-01 15:13:12 +00:00
dependabot[bot]
0daf0bf24c
Bump golang.org/x/net from 0.14.0 to 0.15.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.14.0 to 0.15.0.
- [Commits](https://github.com/golang/net/compare/v0.14.0...v0.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 15:13:02 +00:00
Yijie Qin
57fdd136ab
Add the route ID to uuid ()
* Add the route ID to uuid

Signed-off-by: Yijie Qin <qinyijie@amazon.com>
---------

Signed-off-by: Yijie Qin <qinyijie@amazon.com>
2023-09-29 15:07:52 +01:00
George Robinson
c6be0bcabf
Remove unused function GetAlertmanagerURL ()
Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-09-25 11:11:56 +01:00
Jan Fajerski
b517645d95
Github actions ()
* Move CI to github actions

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* Skip email test in github action

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* build before lint

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

---------

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
2023-09-21 17:22:17 +01:00
George Robinson
5a462df83a
Support UTF-8 label matchers: Add more acceptance tests for braces when using amtool ()
* Add tests for PromQL braces when using amtool alert

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

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-09-21 13:57:11 +01:00
George Robinson
5ba9b9c7c3
Add test for PromQL braces when parsing lists of matchers ()
* Add test for PromQL braces when parsing lists of matchers

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

* Use acceptance tests

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

* Add test creating silence with braces

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

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-09-12 17:00:18 +01:00
Simon Pasquier
aa3e345017
Merge pull request from prometheus/remove-duplicate-msteams-integration
Remove duplicate integration from metrics
2023-09-08 17:01:13 +02:00
xenofree
5906dbc193
docs: fix typo regarding http_proxy for proxy_from_environment ()
* docs: fix typo regarding http_proxy for proxy_from_environment

Signed-off-by: xenofree <35098906+xenofree@users.noreply.github.com>

* docs: add NO_PROXY environment

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: xenofree <35098906+xenofree@users.noreply.github.com>

---------

Signed-off-by: xenofree <35098906+xenofree@users.noreply.github.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2023-09-08 16:45:33 +02:00
gotjosh
eef3708925
Remove duplicate integration from metrics
This is harmless as the vector won't be duplicated but let's remove it anyways.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2023-09-08 15:26:36 +01:00
Colin Douch
cfe4411deb
Add the receiver name to notification metrics ()
* Add receiver name as a label to notify metrics

This commit adds in a second label to the notify family of metrics
(e.g. numTotalFailedNotifications) - the receiver name. This allows
disambiguating which receiver is failing when one has many receivers
with the same integration type

Signed-off-by: sinkingpoint <colin@quirl.co.nz>

* Gate receiver names behind a feature flag

Signed-off-by: sinkingpoint <colin@quirl.co.nz>

---------

Signed-off-by: sinkingpoint <colin@quirl.co.nz>
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Co-authored-by: gotjosh <josue.abreu@gmail.com>
2023-09-06 13:42:55 +01:00
George Robinson
6ce841ca22
Fix scheme required for webhook url in amtool ()
* Fix scheme required for webhook url in amtool

This commit fixes issue  where amtool would fail with
"error: scheme required for webhook url" when using amtool
with --alertmanager.url.

The issue here is that UnmarshalYaml for WebhookConfig checks
if the scheme is present when c.URL is non-nil. However,
UnmarshalYaml for SecretURL returns a non-nil, default value
url.URL{} if the response from api/v2/status contains <secret>
as the webhook URL.

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

* Add test for config routes test

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

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2023-09-05 17:53:24 +01:00
Simon Pasquier
0ac174aa0f
Merge pull request from simonpasquier/merge-release-0.26
Merge release 0.26
2023-09-05 17:02:55 +02:00