[signal] add pprof and message size metrics (#3337)

This commit is contained in:
Pascal Fischer
2025-02-17 17:07:30 +01:00
committed by GitHub
parent 039a985f41
commit abe8da697c
3 changed files with 44 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ import (
"fmt"
"net"
"net/http"
// nolint:gosec
_ "net/http/pprof"
"strings"
"time"
@@ -82,6 +84,8 @@ var (
RunE: func(cmd *cobra.Command, args []string) error {
flag.Parse()
startPprof()
opts, certManager, err := getTLSConfigurations()
if err != nil {
return err
@@ -170,6 +174,15 @@ var (
}
)
func startPprof() {
go func() {
log.Debugf("Starting pprof server on 127.0.0.1:6060")
if err := http.ListenAndServe("127.0.0.1:6060", nil); err != nil {
log.Fatalf("pprof server failed: %v", err)
}
}()
}
func getTLSConfigurations() ([]grpc.ServerOption, *autocert.Manager, error) {
var (
err error