Commit Graph

2600 Commits

Author SHA1 Message Date
inosato 791e542100 Remove ioutil
Signed-off-by: inosato <si17_21@yahoo.co.jp>
2022-07-18 22:01:02 +09:00
Julien Pivotto b1438ccd40
Merge pull request #3008 from roidelapluie/releaseagain
Apply changelog for 0.24
2022-07-18 13:22:35 +02:00
Simon Pasquier af5f6b7b70 Release 0.24.0
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-07-18 10:29:28 +02:00
Julien Pivotto 7c22040b8d
Merge pull request #3007 from prometheus/release-0.24
Release 0.24
2022-07-18 10:28:13 +02:00
gotjosh 0fbc2a7622
Merge pull request #2992 from prometheus/update-silence-api-tests
Refactor POST /api/v1/silences
2022-07-18 09:24:07 +01:00
Wen Long da6de1f1cc
docs: correct the accepted value for X-XSS-Protection header (#3004)
Signed-off-by: heylongdacoder <heylongdacoder@gmail.com>
2022-07-14 00:49:29 +02:00
gotjosh f9c1c9072d
Merge pull request #2994 from prometheus/better-failure-acceptance
Acceptance Tests: Better error messages
2022-07-08 17:12:16 +01:00
gotjosh cbc94fad46
Acceptance Tests: Better error messages
The CI keeps reporting flakes for our acceptance test around the starting and stopping of the Alertmanagers. While I have an idea of where these failures are coming from, it would be nice to get a confirmation by structuring our error messages a bit better.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-07-07 11:09:42 +01:00
gotjosh 4b8b6c1298
Merge pull request #2987 from prometheus/dependabot/go_modules/github.com/go-openapi/validate-0.22.0
Bump github.com/go-openapi/validate from 0.21.0 to 0.22.0
2022-07-07 10:37:37 +01:00
dependabot[bot] 0d7c9dbd95
Bump github.com/go-openapi/validate from 0.21.0 to 0.22.0
Bumps [github.com/go-openapi/validate](https://github.com/go-openapi/validate) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/go-openapi/validate/releases)
- [Commits](https://github.com/go-openapi/validate/compare/v0.21.0...v0.22.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 09:17:54 +00:00
gotjosh 17af1d69d2
Merge pull request #2989 from prometheus/dependabot/go_modules/github.com/go-openapi/spec-0.20.6
Bump github.com/go-openapi/spec from 0.20.4 to 0.20.6
2022-07-07 10:16:55 +01:00
gotjosh 512138d566
Refactor POST /api/v1/silences
As part of #2971, I'm about to extend the test for silences - extract the functions into helpers as part of a separate file and add names to the expectations so that we can easily identify them.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-07-06 18:34:57 +01:00
dependabot[bot] 390fc43409
Bump github.com/go-openapi/spec from 0.20.4 to 0.20.6
Bumps [github.com/go-openapi/spec](https://github.com/go-openapi/spec) from 0.20.4 to 0.20.6.
- [Release notes](https://github.com/go-openapi/spec/releases)
- [Commits](https://github.com/go-openapi/spec/compare/v0.20.4...v0.20.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 10:56:28 +00:00
gotjosh 3f6b65c1ab
Merge pull request #2914 from 3clypse/patch-1
Create dependabot.yml
2022-07-06 11:55:39 +01:00
gotjosh b9149c68f7
Merge pull request #2983 from joeblubaugh/joeblubaugh/simpler-silence-test
Simplify Silence test to remove unnecessary wait.
2022-07-06 11:54:38 +01:00
Joe Blubaugh 01d1e49c54 Simplify Silence test to remove unnecessary wait.
As noted in #2867, there is an unnecessary require.Eventually in a
silence test. This PR addresses that by using a channel to signal that
that the maintenance loop has completed.

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-07-06 09:47:52 +08:00
gotjosh d4c2048be1
Merge pull request #2981 from metalmatze/telegram-defaults
notify/telegram: Set API URL and ParseMode defaults
2022-07-05 13:30:37 +01:00
Matthias Loibl 2785325f07
notify/telegram: Fix test
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2022-07-05 13:12:07 +02:00
Matthias Loibl 3ccff53692
notify/telegram: Update to use default telegram config
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2022-07-05 13:12:06 +02:00
Matthias Loibl 34e60d2c80
notify/telegram: Set API and ParseMode defaults
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2022-07-05 13:12:05 +02:00
gotjosh a68fcc0445
Merge pull request #2867 from joeblubaugh/joeblubaugh/2850/clock-clock
Issue #2850: Add benbjohnson/clock to the silences package.
2022-07-05 11:40:08 +01:00
Joe Blubaugh 505f944c6a Apply suggestions from code review.
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-07-05 11:22:46 +08:00
Joe Blubaugh 0c3bf4b6ce Loosen up the timing on an Eventually to avoid CI timeout
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-07-05 11:22:46 +08:00
Joe Blubaugh c9249a02bc Remove a stray line that was breaking the linter.
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-07-05 11:22:46 +08:00
Joe Blubaugh bedd3c4175 Clean up linter warnings about unused code and atomic package
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-07-05 11:22:46 +08:00
Joe Blubaugh cb00d9259b Issue #2850: Add benbjohnson/clock to the silences package.
github.com/benbjohnson/clock provides a time interface to programs
rather than using the stdlib time package. This allows mocking time in
programs and tests. In this commit, the clock is used to speed up and
simplify testing of the silences package.

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-07-05 11:22:46 +08:00
Max Lowther 4abf1bf1dc
fixed oauth2 doc to reflect tls_config (#2979)
Signed-off-by: Max Lowther <lowther.max@gmail.com>
2022-07-04 16:54:44 +02:00
David Ureba a1dbacb4dd
Create dependabot.yml
Add dependabot dependency check in order to maintain dependencies up-to-date and security updates on time.

Signed-off-by: David Ureba <david.ureba@aiven.io>
2022-07-04 13:19:18 +02:00
gotjosh 528b9588bf
Merge pull request #2972 from prometheus/add-description-to-am-mixin
Mixin: Fix CI linter errors
2022-06-30 12:41:26 +01:00
gotjosh c494009f61
Mixin: Fix mixin linting
In accordance with a new rule introduced as part of https://github.com/grafana/dashboard-linter/pull/79 this is now required. However, for the new rule of `panel-unit-rule` we don't reap any benefits from specifiying a particular unit for our panels, the defaults work perfectly fine so they're ignored.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-06-29 16:25:15 +01:00
gotjosh 3f3e2ce4da
Merge pull request #2950 from gotjosh/change-set-silenced-func-name
Marker: Rename `SetSilenced` to `SetActiveOrSilenced`
2022-06-27 11:01:53 +01:00
gotjosh d2a1fd6364
Merge pull request #2949 from gotjosh/misc-fixes-acceptance-tests
Force close mock servers as part of v2 acceptance tests
2022-06-27 11:00:52 +01:00
gotjosh f66bbab421
Fix tests after rebase
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-06-17 13:20:21 +01:00
gotjosh cfb909f419
Marker: Rename `SetSilenced` to `SetActiveOrSilenced`
This accurately reflects what the function _actually_ does. If no active silences IDs are provided and the list of inhibitions we have is already empty the alert is actually set to Active. Took me a while to realise this as I was understanding how do we populate the alert list.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-06-17 12:51:23 +01:00
gotjosh ef786ea402
Force close mock servers as part of v2 acceptance tests
While merging #2944, I noticed the CI failed: https://app.circleci.com/pipelines/github/prometheus/alertmanager/2686/workflows/b6f87b0a-20c3-455b-b706-432c38a77511/jobs/12028.

It seemed like a deadlock between uncoordinated routines but I couldn't pin point (or reproduce, I tried with -race and -count) the exact problem. However, from the logs, I could point out where the problem originated and kind of have a hunch it had to do with the way net listeners are handled by the TODO removed.

The more worrying bit of the CI failure is that it took 10m to timeout, with this change we'll force close the connection with a 5s deadline so at the very least we'll get the feedback faster.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-06-17 12:43:43 +01:00
gotjosh 805e505288
Alert metric reports different results to what the user sees via API (#2943)
* Alert metric reports different results to what the user sees via API

Fixes #1439 and #2619.

The previous metric is not _technically_ reporting incorrect results as the alerts _are_ still around and will be re-used if that same alert (equal fingerprint) is received before it is GCed. Therefore, I have kept the old metric under a new name `alertmanager_marked_alerts` and repurpose the current metric to match what the user sees in the UI.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-06-16 12:16:06 +02:00
gotjosh 4d09995c26
Mixin: `template-job-rule` now only validates job and not both instance and job (#2944)
With https://github.com/grafana/dashboard-linter/pull/49 `template-job-rule` no longer validates both `instance` and `job` labels. Add the new rule of `template-instance-rule` to the exclusions to preserve the previous behaviour.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-06-15 22:27:11 +02:00
PrometheusBot 51a10f96d8
Update common Prometheus files (#2915)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2022-06-14 00:15:05 +02:00
Julius Volz f958b8be84
Merge pull request #2922 from prometheus/fix-config-formatting
Fix Markdown formatting bugs / typos in the config docs
2022-05-16 09:15:54 +02:00
Julius Volz 73a3fb8da0 Fixup
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2022-05-14 11:13:40 +02:00
Julius Volz 423fa6e3d0 Fix Markdown formatting bugs / typos in the config docs
I noticed that some of the formatting on
https://prometheus.io/docs/alerting/latest/configuration/#time_interval-0 is
broken. This should fix that.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2022-05-13 20:01:21 +02:00
Simon Pasquier 14b01e6a34
Merge pull request #2910 from simonpasquier/fix-opsgenie-configuration-validation
config: fix validation of OpsGenie configuration
2022-05-05 14:22:02 +02:00
gotjosh 661d5c6678 Mixin: Rename exclusion rule from `panel-job-instance-rule` to `target-instance-rule`
Within 9a32e58ed0, the rules have been split into two different rules:

`target-job-rule`
`target-instance-rule`

All of our queries do contain the `job` label but as per the reason, we don't need both in this particular case.

Fixes #2899

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

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-05-05 09:09:28 +02:00
Simon Pasquier 89de86fefc config: fix validation of OpsGenie configuration
The validation should fail if both `api_key` and `api_key_file` are
defined. I think there was a typo in the original PR (#2728) that
enforced `api_url` and `api_key_file` not being defined at the same
time.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-05-04 14:58:41 +02:00
Simon Pasquier 23f961ec6a
.circleci/config.yml: use supported machine image (#2909)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-05-04 13:55:49 +02:00
Furkan Türkal 8424947669
docs: fix installation for go1.18 (#2859)
Signed-off-by: Furkan <furkan.turkal@trendyol.com>
2022-05-04 11:29:50 +02:00
PrometheusBot dcc92eda2e
Update common Prometheus files (#2907)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2022-05-04 10:43:04 +02:00
Julius Volz a38c5b8f1d
Fix stopping of nil Dispatcher (#2897)
The function value and parameters of a defer statement are immediately
evaluated, so this "disp" value is always nil, and calling Stop() on a nil
dispatcher is a no-op, so this does nothing, but wrapping it in a closure
that refers to "disp" fixes it.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2022-05-03 11:00:59 +02:00
Julius Volz 710588f10f
Remove unneeded nil check before ranging over slice (#2900)
Ranging over a nil slice is just a noop as well.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2022-05-02 16:29:04 +02:00
Julius Volz 684484ef49
Remove unused Marker from Dispatcher struct (#2898)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2022-05-02 16:28:29 +02:00