mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Merge pull request #1795 from prometheus/keeping_extra
Clean out old keywords
This commit is contained in:
commit
b16f49bb44
|
@ -18,8 +18,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/prometheus/common/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// item represents a token or text string returned from the scanner.
|
// item represents a token or text string returned from the scanner.
|
||||||
|
@ -194,11 +192,6 @@ const (
|
||||||
itemGroupLeft
|
itemGroupLeft
|
||||||
itemGroupRight
|
itemGroupRight
|
||||||
itemBool
|
itemBool
|
||||||
// Removed keywords. Just here to detect and print errors.
|
|
||||||
itemSummary
|
|
||||||
itemDescription
|
|
||||||
itemRunbook
|
|
||||||
itemKeepExtra
|
|
||||||
keywordsEnd
|
keywordsEnd
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -234,11 +227,6 @@ var key = map[string]itemType{
|
||||||
"group_left": itemGroupLeft,
|
"group_left": itemGroupLeft,
|
||||||
"group_right": itemGroupRight,
|
"group_right": itemGroupRight,
|
||||||
"bool": itemBool,
|
"bool": itemBool,
|
||||||
// Removed keywords. Just here to detect and print errors.
|
|
||||||
"summary": itemSummary,
|
|
||||||
"description": itemDescription,
|
|
||||||
"runbook": itemRunbook,
|
|
||||||
"keeping_extra": itemKeepExtra,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are the default string representations for common items. It does not
|
// These are the default string representations for common items. It does not
|
||||||
|
@ -429,14 +417,6 @@ func (l *lexer) errorf(format string, args ...interface{}) stateFn {
|
||||||
func (l *lexer) nextItem() item {
|
func (l *lexer) nextItem() item {
|
||||||
item := <-l.items
|
item := <-l.items
|
||||||
l.lastPos = item.pos
|
l.lastPos = item.pos
|
||||||
|
|
||||||
// TODO(fabxc): remove for version 1.0.
|
|
||||||
t := item.typ
|
|
||||||
if t == itemSummary || t == itemDescription || t == itemRunbook {
|
|
||||||
log.Errorf("Token %q is not valid anymore. Alerting rule syntax has changed with version 0.17.0. Please read https://prometheus.io/docs/alerting/rules/.", item)
|
|
||||||
} else if t == itemKeepExtra {
|
|
||||||
log.Error("Token 'keeping_extra' is not valid anymore. Use 'keep_common' instead.")
|
|
||||||
}
|
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue