Commit Graph

2684 Commits

Author SHA1 Message Date
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
Matthias Loibl
550952eb51
notify/discord: Create Discord integration
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2022-07-04 22:56:48 +02:00
prombot
cad7bda466 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2022-07-04 19:50:30 +00: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
Alex Gavin
a9b758a952 docs: clarify supported tls cipher suites
Signed-off-by: Alex Gavin <a_gavin@icloud.com>
2022-06-21 11:12:56 -07: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
Julius Volz
34b4eba751
Merge pull request #2904 from grafana/gotjosh/fix-mixtool-linter-errors
Mixin: Rename exclusion rule from `panel-job-instance-rule` to `targert-instance-rule`
2022-05-02 16:05:45 +02:00
gotjosh
35bf59f182
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>
2022-05-02 13:08:22 +01:00
Julius Volz
f30aef2c69
Merge pull request #2901 from prometheus/sort-receiver-stages
Sort receiver stage constructions by pipeline order
2022-05-02 13:56:30 +02:00
Julius Volz
40426fc78b Sort receiver stage constructions by pipeline order
This is less confusing to read if the receiver stages are constructed in the
same order as they are used in the pipeline below.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2022-04-29 23:59:31 +02:00
Julien Pivotto
74ebd3d175
Package and ship frontend independenlty (#2893)
Enable frontend consumption by downstreams, like debian and nixos

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-04-22 12:07:11 +02:00
Mike
71d61c9c91
fix comment (#2869)
Signed-off-by: mikechengwei <842725815@qq.com>
2022-04-08 14:51:02 +02:00
Matthias Loibl
032e0cf60f
Merge pull request #2872 from prometheus/repo_sync
Synchronize common files from prometheus/prometheus
2022-04-05 13:07:06 +02:00
prombot
459acd368d Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2022-03-31 19:50:54 +00:00
Matthias Loibl
a6d10bd5bc
Update golangci-lint and fix complaints (#2853)
* Copy latest golangci-lint files from Prometheus

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Use grafana/regexp over stdlib regexp

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Fix typos in comments

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Fix goimports complains in import sorting

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* gofumpt all Go files

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Update naming to comply with revive linter

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* config: Fix error messages to be lower case

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* test/cli: Fix error messages to be lower case

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* .golangci.yaml: Remove obsolete space

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* config: Fix expected victorOps error

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Use stdlib regexp

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Clean up Go modules

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2022-03-25 17:59:51 +01:00
Simon Pasquier
f484b17fa3
Merge pull request #2864 from simonpasquier/cut-v0.24.0
Release 0.24.0
2022-03-25 10:20:45 +01:00
Simon Pasquier
985c45a36a
Merge pull request #2863 from prometheus/revert-2862-cut-v0.24.0
Revert "Release 0.24.0"
2022-03-25 10:20:23 +01:00
Simon Pasquier
7612aa0b8e
Revert "Release 0.24.0" 2022-03-25 10:07:49 +01:00
Simon Pasquier
b95215b659
Merge pull request #2862 from simonpasquier/cut-v0.24.0
Release 0.24.0
2022-03-25 10:07:28 +01:00
Simon Pasquier
9519d1ba0b Release 0.24.0
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-03-24 14:47:26 +01:00
Leon
dd63d04a57
Add CLI args for snapshot intervals (#2849)
* Add CLI args for snapshot intervals

Signed-off-by: sed-i <82407168+sed-i@users.noreply.github.com>

* Apply suggestions from code review

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

* use same flag for silences and nflogs intervals

Signed-off-by: sed-i <82407168+sed-i@users.noreply.github.com>

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-03-18 17:06:43 +01:00
Simon Pasquier
ec2f5f5894
Merge pull request #2843 from simonpasquier/cut-0.24.0-rc.0
Release 0.24.0-rc.0
2022-03-15 11:45:36 +01:00