Skip to content

Commit f952071

Browse files
committed
Add pprof endpoints to vizier go services
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 8f18541 commit f952071

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/vizier/services/cloud_connector/cloud_connector_server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"errors"
2424
"fmt"
2525
"net/http"
26+
_ "net/http/pprof"
2627
"time"
2728

2829
"github.com/gofrs/uuid"
@@ -174,6 +175,8 @@ func main() {
174175
defer svr.Stop()
175176

176177
mux := http.NewServeMux()
178+
// This handles all the pprof endpoints.
179+
mux.Handle("/debug/", http.DefaultServeMux)
177180
// Set up healthz endpoint.
178181
healthz.RegisterDefaultChecks(mux)
179182
// Set up readyz endpoint.

src/vizier/services/metadata/metadata_server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"crypto/tls"
2424
"fmt"
2525
"net/http"
26+
_ "net/http/pprof"
2627
"os"
2728
"path/filepath"
2829
"strings"
@@ -283,6 +284,8 @@ func main() {
283284
log.WithError(err).Fatal("Failed to create api environment")
284285
}
285286
mux := http.NewServeMux()
287+
// This handles all the pprof endpoints.
288+
mux.Handle("/debug/", http.DefaultServeMux)
286289
healthz.RegisterDefaultChecks(mux)
287290
metrics.MustRegisterMetricsHandlerNoDefaultMetrics(mux)
288291

src/vizier/services/query_broker/query_broker_server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"fmt"
2525
"net"
2626
"net/http"
27+
_ "net/http/pprof"
2728
"time"
2829

2930
"github.com/cenkalti/backoff/v4"
@@ -106,6 +107,8 @@ func main() {
106107
log.WithError(err).Fatal("Failed to create api environment.")
107108
}
108109
mux := http.NewServeMux()
110+
// This handles all the pprof endpoints.
111+
mux.Handle("/debug/", http.DefaultServeMux)
109112
healthz.RegisterDefaultChecks(mux)
110113
metrics.MustRegisterMetricsHandlerNoDefaultMetrics(mux)
111114

0 commit comments

Comments
 (0)