|
|
|
@ -30,6 +30,8 @@ import ( |
|
|
|
"github.com/grafana/regexp" |
|
|
|
"github.com/grafana/regexp" |
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
"github.com/prometheus/common/model" |
|
|
|
"github.com/prometheus/common/model" |
|
|
|
|
|
|
|
"golang.org/x/text/cases" |
|
|
|
|
|
|
|
"golang.org/x/text/language" |
|
|
|
|
|
|
|
|
|
|
|
common_templates "github.com/prometheus/common/helpers/templates" |
|
|
|
common_templates "github.com/prometheus/common/helpers/templates" |
|
|
|
|
|
|
|
|
|
|
|
@ -166,7 +168,7 @@ func NewTemplateExpander( |
|
|
|
return html_template.HTML(text) |
|
|
|
return html_template.HTML(text) |
|
|
|
}, |
|
|
|
}, |
|
|
|
"match": regexp.MatchString, |
|
|
|
"match": regexp.MatchString, |
|
|
|
"title": strings.Title, //nolint:staticcheck // TODO(beorn7): Need to come up with a replacement using the cases package.
|
|
|
|
"title": cases.Title(language.AmericanEnglish, cases.NoLower).String, |
|
|
|
"toUpper": strings.ToUpper, |
|
|
|
"toUpper": strings.ToUpper, |
|
|
|
"toLower": strings.ToLower, |
|
|
|
"toLower": strings.ToLower, |
|
|
|
"graphLink": strutil.GraphLinkForExpression, |
|
|
|
"graphLink": strutil.GraphLinkForExpression, |
|
|
|
|