Simon Pasquier
a60431f3cd
Merge v2.7.1 into master ( #5170 )
...
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
6 years ago
Ganesh Vernekar
787eb1e904
Set rule_group_last_duration_seconds to seconds ( #5153 )
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Matt Layher
302148fd69
*: apply gofmt -s
...
Signed-off-by: Matt Layher <mdlayher@gmail.com>
6 years ago
Vishnunarayan K I
fd3ef6ba34
Add metric rule_group_rules_loaded to get the number of rules loaded ( #5090 )
...
Signed-off-by: Vishnunarayan K I <appukuttancr@gmail.com>
6 years ago
Simon Pasquier
f678e27eb6
*: use latest release of staticcheck ( #5057 )
...
* *: use latest release of staticcheck
It also fixes a couple of things in the code flagged by the additional
checks.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Use official release of staticcheck
Also run 'go list' before staticcheck to avoid failures when downloading packages.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
6 years ago
Tom Wilkie
121603c417
Expose rules.NewGroupMetrics and rules.Metrics. ( #5059 )
...
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
6 years ago
Tom Wilkie
6e08029b56
Move err to be the last return value from storage.Select. ( #5054 )
...
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
6 years ago
Bartek Płotka
de213d4a5e
rule manager: Moved metric registration to custom registerer which is already available. ( #4961 )
...
Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
6 years ago
AixesHunter
fb8479a677
Variable 'labels' collides with imported package name ( #5012 )
...
Signed-off-by: aixeshunter <aixeshunter@gmail.com>
6 years ago
mknapphrt
f0e9196dca
Return warnings on a remote read fail ( #4832 )
...
Signed-off-by: Mark Knapp <mknapp@hudson-trading.com>
6 years ago
Krasi Georgiev
0754e5334b
querier for RestoreForState not closed. ( #4922 )
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Ben Kochie
c6399296dc
Fix spelling/typos ( #4921 )
...
* Fix spelling/typos
Fix spelling/typos reported by codespell/misspell.
* UK -> US spelling changes.
Signed-off-by: Ben Kochie <superq@gmail.com>
6 years ago
Wei Guo
e329cbf673
Add metric prometheus_rule_group_last_evaluation for recording and alerting ( #4852 )
...
* add metric prometheus_rule_group_last_evaluation for recording and alerting
Signed-off-by: Wei Guo <me@imkira.com>
* fix issues from comments
Signed-off-by: Wei Guo <me@imkira.com>
6 years ago
Will Hegedus
193ebe7e34
Updates to /targets and /rules (scrape duration, last evaluation time) ( #4722 )
...
* Add evaluationTimestamp (Last Evaluation) column to display on /rules
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Add lastScrapeDuration ("Scrape Duration") to display on /targets
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Updates based on Julius' feedback
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Update to set timestamp to when eval started (after eval completes)
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Update /rules to display time since last evaluation
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Re-order Last Eval/Eval Time to be consistent with targets page
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
6 years ago
Callum Styan
9bca041285
WIP: keep track of samples per query, set a max # of samples ( #4513 )
...
* keep track of samples per query, set a max # of samples that can be in
memory at once
Signed-off-by: Callum Styan <callumstyan@gmail.com>
6 years ago
Ganesh Vernekar
5790d23fd8
Unit testing for rules ( #4350 )
...
* Unit testing for rules
* Specifying order of group evaluation in unit tests
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Ganesh Vernekar
05726c5ea2
Test template expansion while loading groups ( #4537 )
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Chris Marchbanks
63ed9d1b70
Send EndsAt along with alerts ( #4550 )
...
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
6 years ago
Chris Marchbanks
87f1dad16d
throttle resends of alerts to 1 minute by default ( #4538 )
...
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
6 years ago
Goutham Veeramachaneni
f3b7c22827
rules: add comment about lock taking ( #4525 )
...
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
6 years ago
Ganesh Vernekar
c663477688
Fixed TestUpdate in rules/manager_test.go ( #4516 )
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Julius Volz
8fbe1b5133
Handle a bunch of unchecked errors ( #4461 )
...
There are many more (mostly finalizers like Close/Stop/etc.), but most of
the others seemed like one couldn't do much about them anyway.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
6 years ago
Ganesh Vernekar
a0a9e7df91
Fix TestForStateRestore ( #4476 ) ( #4512 )
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Julien Pivotto
0b4d22b245
rules/manager: remove a no-longer-relevant comment ( #4503 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
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
Fabian Reinartz
b7e2f407de
rules: Fix double-locking of mutex
...
Signed-off-by: Fabian Reinartz <freinartz@google.com>
6 years ago
Benji Visser
8bb6e0dd6e
Show rule evaluation errors on rules page ( #4457 )
...
* adding information about the health and errors for Rules
adding Health() and LastError() to the Rule interface. This will allow
us to easily surface information about rules.
Signed-off-by: noqcks <benny@noqcks.io>
* updating rules.html with fields for Rule errors and health state
Signed-off-by: noqcks <benny@noqcks.io>
* fix code comment grammar & access Rule health/error info using a mutex
Signed-off-by: noqcks <benny@noqcks.io>
* s/Errors/Error/ in rules.html to remain consistent with targets.html
Signed-off-by: noqcks <benny@noqcks.io>
* adding periods to code comments in reporting/alerting
Signed-off-by: noqcks <benny@noqcks.io>
* putting health/error below mutex in struct field
Signed-off-by: noqcks <benny@noqcks.io>
6 years ago
Julius Volz
2b8fc062a8
rules: HTML-escape rule YAML marshal errors ( #4464 )
...
This was pointed out by `gosec`.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
6 years ago
Julius Volz
90521a65f8
Remove error return value from NotifyFunc() ( #4459 )
...
It's always nil and we also forgot to check it.
Signed-off-by: Julius Volz <julius.volz@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
Max Leonard Inden
71fafad099
api/v1: Coninue work exposing rules and alerts
...
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
6 years ago
mg03
31f8ca0dfb
api v1 alerts/rules json endpoint
...
Signed-off-by: mg03 <mgeng03@gmail.com>
6 years ago
Bryan Boreham
afdb66dfac
Expose Group.CopyState() ( #4304 )
...
This makes the `rules` package more useful to projects that use
Prometheus as a library.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
6 years ago
Julius Volz
9e3171f6e3
rules: Minor naming/comment cleanups ( #4328 )
...
Signed-off-by: Julius Volz <julius.volz@gmail.com>
6 years ago
Bryan Boreham
2bd510a63e
Make TestUpdate() do some work ( #4306 )
...
Previously it would set no preconditions and check no postconditions,
as the `groups` member was empty.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
7 years ago
Alin Sinpalean
9dc763cc03
Run rule evaluation with timestamps precisely evaluation_interval apart ( #4201 )
...
* Run rule evaluation with timestamps precisely evaluation_interval apart from one another.
Signed-off-by: Alin Sinpalean <alin.sinpalean@gmail.com>
7 years ago
Mario Trangoni
464e747f1e
fix some comments typos ( #4059 )
7 years ago
Bryan Boreham
93494d8b7e
Add an OpenTracing span for each rule ( #4027 )
...
* Add an OpenTracing span for each rule
So that tags and child spans can be traced back to the rule that they
refer to.
7 years ago
ferhat elmas
ec8e4d8a7c
all: remove unnecessary type conversions ( #3992 )
...
excep promql due to not to create conflict with #3966 .
7 years ago
Warren Fernandes
58e2a31db8
Cleans up test by removing unused function ( #3969 )
7 years ago
ferhat elmas
ffa673f7d8
General simplifications ( #3887 )
...
Another try as in #1516
7 years ago
Fabian Reinartz
7ccd4b39b8
*: implement query params
...
This adds a parameter to the storage selection interface which allows
query engine(s) to pass information about the operations surrounding a
data selection.
This can for example be used by remote storage backends to infer the
correct downsampling aggregates that need to be provided.
7 years ago
Simon Pasquier
81c0ab69e0
Don't reset FiredAt for inactive alerts
...
Otherwise AlertManager receives resolved alerts where StartsAt is zero which
fails the validation.
7 years ago
Brian Brazil
30b4439bbd
Remove rule_type label from rule metrics.
...
This is not really needed now that we have rule groups
to distinguish rules.
7 years ago
Brian Brazil
b97f4cf48c
Add metrics for rule group interval and last duration.
7 years ago
Brian Brazil
0a42a9fc8f
Copy over rule group duration on reload.
...
This is currently getting lost, this will soon be in a metric and we
don't want it dropping to 0 on every reload.
7 years ago
Brian Brazil
aa370fa568
Clarify metric names around rule groups.
...
Make it clear they're about overall rule groups.
7 years ago
Fabian Reinartz
62461379b7
rules: decouple notifier packages
...
The dependency on the notifier packages caused a transitive dependency
on discovery and with that all client libraries our service discovery
uses.
7 years ago
Fabian Reinartz
4d964a0a0d
rules: make glob expansion a concern of main
7 years ago
Fabian Reinartz
bd9f7460eb
rules: remove config package dependency
7 years ago