File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -383,14 +383,13 @@ func main() {
383383 registry .MustRegister (collector .NewNginxCollector (ossClient .(* client.NginxClient ), "nginx" , constLabels .labels ))
384384 }
385385 http .Handle (* metricsPath , promhttp .HandlerFor (registry , promhttp.HandlerOpts {}))
386+
386387 http .HandleFunc ("/" , func (w http.ResponseWriter , r * http.Request ) {
387- _ , err := w .Write ([]byte (`<html>
388- <head><title>NGINX Exporter</title></head>
389- <body>
388+ _ , err := fmt .Fprintf (w , `<!DOCTYPE html>
389+ <title>NGINX Exporter</title>
390390 <h1>NGINX Exporter</h1>
391- <p><a href='/metrics'>Metrics</a></p>
392- </body>
393- </html>` ))
391+ <p><a href=%q>Metrics</a></p>` ,
392+ * metricsPath )
394393 if err != nil {
395394 log .Printf ("Error while sending a response for the '/' path: %v" , err )
396395 }
You can’t perform that action at this time.
0 commit comments