mirror of
https://github.com/openziti/zrok.git
synced 2024-12-22 23:02:52 +01:00
support for pprof endpoint
This commit is contained in:
parent
4420254c5c
commit
1578ecca98
@ -34,8 +34,9 @@ type Config struct {
|
||||
}
|
||||
|
||||
type AdminConfig struct {
|
||||
Secrets []string `cf:"+secret"`
|
||||
TouLink string
|
||||
Secrets []string `cf:"+secret"`
|
||||
TouLink string
|
||||
ProfileEndpoint string
|
||||
}
|
||||
|
||||
type EndpointConfig struct {
|
||||
|
@ -2,11 +2,13 @@ package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/openziti/zrok/controller/config"
|
||||
"github.com/openziti/zrok/controller/limits"
|
||||
"github.com/openziti/zrok/controller/metrics"
|
||||
"github.com/sirupsen/logrus"
|
||||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
|
||||
"github.com/go-openapi/loads"
|
||||
influxdb2 "github.com/influxdata/influxdb-client-go/v2"
|
||||
@ -26,6 +28,12 @@ var limitsAgent *limits.Agent
|
||||
func Run(inCfg *config.Config) error {
|
||||
cfg = inCfg
|
||||
|
||||
if cfg.Admin != nil && cfg.Admin.ProfileEndpoint != "" {
|
||||
go func() {
|
||||
log.Println(http.ListenAndServe(cfg.Admin.ProfileEndpoint, nil))
|
||||
}()
|
||||
}
|
||||
|
||||
swaggerSpec, err := loads.Embedded(rest_server_zrok.SwaggerJSON, rest_server_zrok.FlatSwaggerJSON)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error loading embedded swagger spec")
|
||||
|
Loading…
Reference in New Issue
Block a user