diff --git a/rules/manager.go b/rules/manager.go index a901991f0..e52f72e32 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -30,7 +30,7 @@ import ( "github.com/prometheus/prometheus/notification" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/storage" - "github.com/prometheus/prometheus/templates" + "github.com/prometheus/prometheus/template" "github.com/prometheus/prometheus/utility" ) @@ -195,8 +195,8 @@ func (m *Manager) queueAlertNotifications(rule *AlertingRule, timestamp clientmo defs := "{{$labels := .Labels}}{{$value := .Value}}" expand := func(text string) string { - template := templates.NewTemplateExpander(defs+text, "__alert_"+rule.Name(), tmplData, timestamp, m.queryEngine, m.pathPrefix) - result, err := template.Expand() + tmpl := template.NewTemplateExpander(defs+text, "__alert_"+rule.Name(), tmplData, timestamp, m.queryEngine, m.pathPrefix) + result, err := tmpl.Expand() if err != nil { result = err.Error() log.Warnf("Error expanding alert template %v with data '%v': %v", rule.Name(), tmplData, err) diff --git a/templates/templates.go b/template/template.go similarity index 99% rename from templates/templates.go rename to template/template.go index e7992db56..cb158d609 100644 --- a/templates/templates.go +++ b/template/template.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package templates +package template import ( "bytes" diff --git a/templates/templates_test.go b/template/template_test.go similarity index 99% rename from templates/templates_test.go rename to template/template_test.go index 10799065c..7c3c47311 100644 --- a/templates/templates_test.go +++ b/template/template_test.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package templates +package template import ( "math" diff --git a/web/consoles.go b/web/consoles.go index 9c2da52cf..27e70e05f 100644 --- a/web/consoles.go +++ b/web/consoles.go @@ -23,7 +23,7 @@ import ( clientmodel "github.com/prometheus/client_golang/model" "github.com/prometheus/prometheus/promql" - "github.com/prometheus/prometheus/templates" + "github.com/prometheus/prometheus/template" ) var ( @@ -70,13 +70,13 @@ func (h *ConsolesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { Path: r.URL.Path, } - template := templates.NewTemplateExpander(string(text), "__console_"+r.URL.Path, data, clientmodel.Now(), h.QueryEngine, h.PathPrefix) + tmpl := template.NewTemplateExpander(string(text), "__console_"+r.URL.Path, data, clientmodel.Now(), h.QueryEngine, h.PathPrefix) filenames, err := filepath.Glob(*consoleLibrariesPath + "/*.lib") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } - result, err := template.ExpandHTML(filenames) + result, err := tmpl.ExpandHTML(filenames) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return