From d16ede358a2ec049bda28bf37e79c9cfcaa64c29 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 17 Sep 2020 23:46:24 -0400 Subject: metrics: Fix hidden panic while observing with bad exemplars (#3733) * metrics: Fixing panic while observing with bad exemplars Signed-off-by: Dave Henderson * Minor cleanup The server is already added to the context. So, we can simply use that to get the server name, which is a field on the server. * Add integration test for auto HTTP->HTTPS redirects A test like this would have caught the problem in the first place Co-authored-by: Matthew Holt --- modules/caddyhttp/app.go | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/caddyhttp/app.go') diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go index 375ca4d..41820ea 100644 --- a/modules/caddyhttp/app.go +++ b/modules/caddyhttp/app.go @@ -155,6 +155,7 @@ func (app *App) Provision(ctx caddy.Context) error { // prepare each server for srvName, srv := range app.Servers { + srv.name = srvName srv.tlsApp = app.tlsApp srv.logger = app.logger.Named("log") srv.errorLogger = app.logger.Named("log.error") -- cgit v1.2.3