Matthieu MOREL
ddfa9a7cc5
refactor (rules): move from github.com/pkg/errors to 'errors' and 'fmt' ( #10855 )
...
* refactor (rules): move from github.com/pkg/errors to 'errors' and 'fmt'
Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
2 years ago
Julien Pivotto
0d94cdf107
rules: remove classic UI code ( #10730 )
...
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
3 years ago
Wilbert Guo
83a2e52bc2
Add SyncForState Implementation for Ruler HA ( #10070 )
...
* continuously syncing activeAt for alerts
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
* add import
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
* Refactor SyncForState and add unit tests
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
* Format code
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
* Add hook for syncForState
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
Fix go lint
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
Refactor syncForState override implementation
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
Add syncForState override func as argument to Update()
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
Fix go formatting
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
Fix circleci test errors
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
Remove overrideFunc as argument to run()
Signed-off-by: Wilbert Guo <wilbeguo@amazon.com>
* remove the syncForState
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* use the override function to decide if need to replace the activeAt or not
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fix test case
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fix format
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* Trigger build
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fixing comments
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* return the result of map of alerts instead of single one
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* upper case the QueryforStateSeries
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* use a more generic rule group post process function type
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fix indentation
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fix gofmt
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fix lint
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fixing naming
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fix comments
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* add the lastEvalTimestamp as parameter
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* fmt
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
* change funcType to func
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
Co-authored-by: Yijie Qin <qinyijie@amazon.com>
Co-authored-by: Yijie Qin <63399121+qinxx108@users.noreply.github.com>
3 years ago
beorn7
c954cd9d1d
Move packages out of deprecated pkg directory
...
This creates a new `model` directory and moves all data-model related
packages over there:
exemplar labels relabel rulefmt textparse timestamp value
All the others are more or less utilities and have been moved to `util`:
gate logging modetimevfs pool runtime
Signed-off-by: beorn7 <beorn@grafana.com>
3 years ago
Levi Harrison
d81bbe154d
Rule alerts/series limit updates ( #9541 )
...
* Add docs and do not limit inactive alerts.
Signed-off-by: Levi Harrison <git@leviharrison.dev>
3 years ago
Levi Harrison
dc2f1993d8
Limit number of alerts or series produced by a rule ( #9260 )
...
* Add limit to rules
Signed-off-by: Levi Harrison <git@leviharrison.dev>
3 years ago
Levi Harrison
b5f6f8fb36
Switched to go-kit/log
...
Signed-off-by: Levi Harrison <git@leviharrison.dev>
4 years ago
Levi Harrison
26274527df
Updated/added tests
...
Signed-off-by: Levi Harrison <git@leviharrison.dev>
4 years ago
Julien Pivotto
6c56a1faaa
Testify: move to require ( #8122 )
...
* Testify: move to require
Moving testify to require to fail tests early in case of errors.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* More moves
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
1282d1b39c
Refactor test assertions ( #8110 )
...
* Refactor test assertions
This pull request gets rid of assert.True where possible to use
fine-grained assertions.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
4e5b1722b3
Move away from testutil, refactor imports ( #8087 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Guangwen Feng
487f1e07ff
Add unit test case for func State in alerting.go ( #7476 )
...
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
4 years ago
Tobias Guggenmos
6c00f2ffcb
Comment fixes
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Julien Pivotto
9adad8ad30
Remove MaxConcurrent from the PromQL engine opts ( #6712 )
...
Since we use ActiveQueryTracker to check for concurrency in
d992c36b3a
it does not make sense to keep
the MaxConcurrent value as an option of the PromQL engine.
This pull request removes it from the PromQL engine options, sets the
max concurrent metric to -1 if there is no active query tracker, and use
the value of the active query tracker otherwise.
It removes dead code and also will inform people who import the promql
package that we made that change, as it breaks the EngineOpts struct.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Julien Pivotto
cf42888e4d
Fix order of testutil.Equals ( #6695 )
...
Equals takes the expected value as first parameter, and the actual value
as second parameter.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Julien Pivotto
2d7c8069d0
Check that rules don't contain metrics with the same labelset ( #6469 )
...
Closes #5529
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Brian Brazil
e62f30d497
Correctly handle empty labels from alert templates. ( #5845 )
...
Fixes https://github.com/prometheus/common/issues/36
Move logic handling this into the labels package,
so all the cases are handled in one place and we're
less likely to have this come up again.
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
5 years ago
Bjoern Rabenstein
76102d570c
Add test for external labels in label template
...
Signed-off-by: Bjoern Rabenstein <bjoern@rabenste.in>
6 years ago
Bjoern Rabenstein
38d518c0fe
Rework #5009 after comments
...
Signed-off-by: Bjoern Rabenstein <bjoern@rabenste.in>
6 years ago
Matt Layher
302148fd69
*: apply gofmt -s
...
Signed-off-by: Matt Layher <mdlayher@gmail.com>
6 years ago
Chris Marchbanks
11155c7028
Existing alert labels will update based on templates ( #4500 )
...
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
6 years ago
Ganesh Vernekar
f1db699dff
Persist alert 'for' state across restarts ( #4061 )
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Jorge Hernández
6cd0f63eb1
Use testutil in rules subpackage ( #3278 )
...
* Use testutil in rules subpackage
* Fix manager test
* Use testutil in rules subpackage
* Fix manager test
* Fix rebase
* Change to testutil for applyConfig tests
7 years ago
beorn7
c2e9a151ab
Make all rule links link to the "Console" tab rather than "Graph"
...
Clicking on a rule, either the name or the expression, opens the rule
result (or the corresponding expression, repsectively) in the
expression browser. This should by default happen in the console tab,
as, more often than not, displaying it in the graph tab runs into a
timeout.
7 years ago
Fabian Reinartz
d21f149745
*: migrate to go-kit/log
7 years ago
Goutham Veeramachaneni
e1fc9dc78d
Move /rules to new format ( #2901 )
...
Fixes #2891
Signed-off-by: Goutham Veeramachaneni <goutham@boomerangcommerce.com>
7 years ago
Goutham Veeramachaneni
507790a357
Rework logging to use explicitly passed logger
...
Mostly cleaned up the global logger use. Still some uses in discovery
package.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Alexey Palazhchenko
b0e1ea7c6c
Simplify code, fix typos. ( #2719 )
8 years ago
Julius Volz
fe11c5933a
Fix mutation of active alert elements by notifier ( #2656 )
...
This caused the external label application in the notifier to bleed back
into the rule manager's active alerting elements.
8 years ago
Fabian Reinartz
e94b0899ee
rules: fix tests, remove model types
8 years ago
beorn7
75bae065fd
Revert "Modify tests to adjust to reverting the /graph changes"
...
This reverts commit f1ea5bf232
.
Part two necessary for reverting the /graph revert.
8 years ago
beorn7
f1ea5bf232
Modify tests to adjust to reverting the /graph changes
...
These tests have been added after the /graph changes and therefore
already test the new syntax.
This commit has to be reverted together with the previous one to get
back to the old new state. *sigh*
8 years ago
Julius Volz
fe7b8b7fd1
Add missing license header to alerting_test.go
8 years ago
Julius Volz
da7206ec29
Fix rule HTML escaping issues
...
This was mentioned as part of https://github.com/prometheus/alertmanager/issues/452
8 years ago