Implement Prometheus metrics
This commit is contained in:
parent
4b52934656
commit
ae6687b7d2
2 changed files with 5 additions and 0 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/dutchcoders/go-clamd"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
var opts map[string]string
|
||||
|
@ -184,6 +185,9 @@ func main() {
|
|||
http.HandleFunc("/scanPath", scanPathHandler)
|
||||
http.HandleFunc("/", home)
|
||||
|
||||
// Prometheus metrics
|
||||
http.Handle("/metrics", promhttp.Handler())
|
||||
|
||||
// Start the HTTPS server in a goroutine
|
||||
go http.ListenAndServeTLS(SSL_PORT, "/etc/ssl/clamav-rest/server.crt", "/etc/ssl/clamav-rest/server.key", nil)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue