suntala
44f385fd51
Support expansion of native histogram values in alert templates
...
Co-authored-by: Aleks Fazlieva <britishrum@users.noreply.github.com>
Signed-off-by: suntala <arati.rana@grafana.com>
8 months ago
Julien Pivotto
c52db2b196
Remove duplicate tests
...
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
1 year ago
johncming
5d68ebb207
pkg/rulefmt: fix bug of validate.
...
Signed-off-by: johncming <johncming@yahoo.com>
1 year ago
Julien Pivotto
ce55e5074d
Add 'keep_firing_for' field to alerting rules
...
This commit adds a new 'keep_firing_for' field to Prometheus alerting
rules. The 'resolve_delay' field specifies the minimum amount of time
that an alert should remain firing, even if the expression does not
return any results.
This feature was discussed at a previous dev summit, and it was
determined that a feature like this would be useful in order to allow
the expression time to stabilize and prevent confusing resolved messages
from being propagated through Alertmanager.
This approach is simpler than having two PromQL queries, as was
sometimes discussed, and it should be easy to implement.
This commit does not include tests for the 'resolve_delay' field. This
is intentional, as the purpose of this commit is to gather comments on
the proposed design of the 'resolve_delay' field before implementing
tests. Once the design of the 'resolve_delay' field has been finalized,
a follow-up commit will be submitted with tests."
See https://github.com/prometheus/prometheus/issues/11570
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2 years ago
Cosrider
bef6556ca5
delete redundant alias ( #11180 )
...
Signed-off-by: Cosrider <cosrider7@gmail.com>
Signed-off-by: Cosrider <cosrider7@gmail.com>
2 years ago
Matthieu MOREL
c2b4de3611
refactor (package model): move from github.com/pkg/errors to 'errors' and 'fmt' packages ( #10747 )
...
Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
Co-Authored-By: Julien Pivotto <roidelapluie@gmail.com>
Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
2 years ago
Łukasz Mierzwa
648b12d8c5
Implement Unwrap() on errors returned from rulefmt
...
I'd like to unwrap errors returned from rulefmt but both Error and WrappedError types are missing Unwrap() method.
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2 years ago
Matthieu MOREL
e2ede285a2
refactor: move from io/ioutil to io and os packages ( #10528 )
...
* refactor: move from io/ioutil to io and os packages
* use fs.DirEntry instead of os.FileInfo after os.ReadDir
Signed-off-by: MOREL Matthieu <matthieu.morel@cnp.fr>
3 years ago
ozairasim
52159840eb
Expose Error function for WrappedError ( #9662 )
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
Howie
4e1dacf2d1
fix issue #9432(uses reference to loop iterator variable ) ( #9483 )
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
George Robinson
049b4f4f13
Support customization of template options in TemplateExpander ( #9290 )
...
Signed-off-by: George Robinson <george.robinson@grafana.com>
3 years ago
Levi Harrison
17ea8d006a
Added external URL access
...
Signed-off-by: Levi Harrison <git@leviharrison.dev>
4 years ago
Max Neverov
7c8bbd6bcb
Add fmt rule check: labels with the name __name__ are invalid ( #7787 )
...
Signed-off-by: Max Neverov <neverov.max@gmail.com>
4 years ago
Julien Pivotto
fd06416057
Use strict unmarshalling of rules ( #7767 )
...
* Fix unmarshalling of rules
Fix #7042
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Callum Styan
0f76024eeb
Clarify error messaging, group names must be provided. ( #7529 )
...
Signed-off-by: Callum Styan <callumstyan@gmail.com>
4 years ago
Mikael Johansson
a98be49c52
Change rule index numbering from 0 to n+1 on errors found in rule files ( #7495 )
...
* Change rule index numbering from 0 to n+1 on errors found in rule files
Signed-off-by: Mikael Johansson <mik.json@gmail.com>
4 years ago
johncming
51c824543b
fix bug missing an error. ( #7020 )
...
Signed-off-by: johncming <johncming@yahoo.com>
5 years ago
Tobias Guggenmos
20b1f596f6
Fix build errors in rest of prometheus
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Harkishen Singh
84e6459c4d
Adds support for line-column numbers for invalid rules, promtool ( #6533 )
...
Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>
5 years ago
Josh Soref
91d76c8023
Spelling ( #6517 )
...
* spelling: alertmanager
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: attributes
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: autocomplete
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: bootstrap
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: caught
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: chunkenc
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: compaction
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: corrupted
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: deletable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: expected
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: fine-grained
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: initialized
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: iteration
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: javascript
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: multiple
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: number
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: overlapping
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: possible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: postings
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: procedure
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: programmatic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: queuing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: querier
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: repairing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: received
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: reproducible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: retention
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: sample
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: segements
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: semantic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: software [LICENSE]
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: staging
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: timestamp
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: unfortunately
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: uvarint
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: subsequently
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: ressamples
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
5 years ago
Simon Pasquier
06066a3619
*: improve error messages when parsing bad rules ( #5965 )
...
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
5 years ago
Bjoern Rabenstein
38d518c0fe
Rework #5009 after comments
...
Signed-off-by: Bjoern Rabenstein <bjoern@rabenste.in>
6 years ago
Sylvain Rabot
335a34486e
Add external labels to template expansion
...
This affects the expansion of templates in alert labels and
annotations and console templates.
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
6 years ago
Tariq Ibrahim
8fdfa8abea
refine error handling in prometheus ( #5388 )
...
i) Uses the more idiomatic Wrap and Wrapf methods for creating nested errors.
ii) Fixes some incorrect usages of fmt.Errorf where the error messages don't have any formatting directives.
iii) Does away with the use of fmt package for errors in favour of pkg/errors
Signed-off-by: tariqibrahim <tariq181290@gmail.com>
6 years ago
AixesHunter
29f21b8d0c
import aliases yaml that can be omitted ( #5018 )
...
Signed-off-by: aixeshunter <aixeshunter@gmail.com>
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
Manos Fokas
25f929b772
Yaml UnmarshalStrict implementation. ( #4033 )
...
* Updated yaml vendor package.
* remove checkOverflow duplicate in rulefmt
* remove duplicated HTTPClientConfig.Validate()
* Added yaml static check.
7 years ago
Julius Volz
192e665317
rulefmt: Allow parsing from bytes instead of file
...
This makes the rulefmt package more reusable for users whose rulesets are not
stored in files on disk. Concrete example: Cortex.
7 years ago
Conor Broderick
59d4c539d1
Added rule name to rule error for easier debugging ( #3549 )
7 years ago
Krasi Georgiev
3697075b8f
validates that the recording name to include only allowed characters. ( #3305 )
7 years ago
Goutham Veeramachaneni
592cb00c2f
Remove version from RuleGroups
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
6b70a4d850
Incorporate PR feedback
...
* Move fingerprint to Hash()
* Move away from tsdb.MultiError
* 0777 -> 0666 for files
* checkOverflow of extra fields
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
dc69645e92
Move back to go-yaml
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
e893c89333
Validate labels and annotations
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
c884881f7d
Add License Header
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
2d1e92513b
Add tests
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
a48a018368
Make sure groups are unique in a single file
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
cea1e99f78
Add update-rules command to promtool
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
8 years ago
Goutham Veeramachaneni
e8f55669ea
Move rules to new format
...
Signed-off-by: Goutham Veeramachaneni <goutham@boomerangcommerce.com>
8 years ago
Fabian Reinartz
c843a0cd29
pkg/rulefmt: Add rule group parsing
8 years ago