diff --git a/provider/sqlite/sqlite.go b/provider/sqlite/sqlite.go index 069d0e99..de76f1a4 100644 --- a/provider/sqlite/sqlite.go +++ b/provider/sqlite/sqlite.go @@ -25,6 +25,7 @@ CREATE TABLE IF NOT EXISTS alerts ( updated_at timestamp, timeout integer ); +CREATE INDEX IF NOT EXISTS fingerprint ON alerts (fingerprint); CREATE INDEX IF NOT EXISTS alerts_start ON alerts (starts_at); CREATE INDEX IF NOT EXISTS alerts_end ON alerts (ends_at); CREATE INDEX IF NOT EXISTS alerts_updated ON alerts (updated_at); @@ -600,6 +601,9 @@ func (s *Silences) Set(sil *types.Silence) (uint64, error) { // Del implements the Silences interface. func (s *Silences) Del(sid uint64) error { + dbmtx.Lock() + defer dbmtx.Unlock() + tx, err := s.db.Begin() if err != nil { return err diff --git a/web.go b/web.go index fdfc8666..6e203849 100644 --- a/web.go +++ b/web.go @@ -17,6 +17,7 @@ import ( "bytes" "io" "net/http" + _ "net/http/pprof" // Comment this line to disable pprof endpoint. "path/filepath" "github.com/prometheus/client_golang/prometheus" @@ -67,4 +68,7 @@ func RegisterWeb(r *route.Router) { r.Get("/", ihf("index", func(w http.ResponseWriter, req *http.Request) { serveAsset(w, req, "ui/app/index.html") })) + + r.Get("/debug/*subpath", http.DefaultServeMux.ServeHTTP) + r.Post("/debug/*subpath", http.DefaultServeMux.ServeHTTP) }