Skip to content

Commit

Permalink
Update configuration for turning profiling on/off (#1149)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Byrgazov <[email protected]>
Co-authored-by: Vladislav Byrgazov <[email protected]>
  • Loading branch information
Ex4amp1e and Vladislav Byrgazov authored Aug 14, 2024
1 parent b850427 commit 812c3ba
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docker build .
* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint
* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports
* `NSM_PPROF_ENABLED` - is pprof enabled (default: "false")
* `NSM_PPROF_PORT` - pprof port (default: "6060")
* `NSM_PPROF_LISTEN_ON` - pprof URL to ListenAndServe (default: "localhost:6060")
* `NSM_TUNNEL_IP` - IP to use for tunnels
* `NSM_VXLAN_PORT` - VXLAN port to use
* `NSM_VPP_API_SOCKET` - filename of socket to connect to existing VPP instance.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/kelseyhightower/envconfig v1.4.0
github.com/networkservicemesh/api v1.13.1-0.20240424210452-d0df98851760
github.com/networkservicemesh/govpp v0.0.0-20240328101142-8a444680fbba
github.com/networkservicemesh/sdk v0.5.1-0.20240808113433-ce2c8f56bdd3
github.com/networkservicemesh/sdk v0.5.1-0.20240812103952-7e0cf2c383fb
github.com/networkservicemesh/sdk-k8s v0.0.0-20240808144602-8fb8c883a89f
github.com/networkservicemesh/sdk-kernel v0.0.0-20240808113656-bf53cf3dc339
github.com/networkservicemesh/sdk-sriov v0.0.0-20240808114059-19b4478ca63e
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ github.com/networkservicemesh/api v1.13.1-0.20240424210452-d0df98851760 h1:EaWGg
github.com/networkservicemesh/api v1.13.1-0.20240424210452-d0df98851760/go.mod h1:B8FmS3XZ7NZY7ZEtdcNg2NHYppDHlr4kl4eecdZN9eI=
github.com/networkservicemesh/govpp v0.0.0-20240328101142-8a444680fbba h1:7B6X6N7rwJNpnfsUlBavxuZdYqTx8nAKwxVS/AkuX1o=
github.com/networkservicemesh/govpp v0.0.0-20240328101142-8a444680fbba/go.mod h1:CwikXQ3p/y3j6+HbQQWXKv0f4LPyUd2vKTiViG93qWA=
github.com/networkservicemesh/sdk v0.5.1-0.20240808113433-ce2c8f56bdd3 h1:EukdHtlzP75dfF3vG6kukJ0oqBhzxZKOlbKP4rAquhg=
github.com/networkservicemesh/sdk v0.5.1-0.20240808113433-ce2c8f56bdd3/go.mod h1:soFR6Mg5LTVvEI0zXNcbWoBnn4hqUK7ItZBQJ3Jbszo=
github.com/networkservicemesh/sdk v0.5.1-0.20240812103952-7e0cf2c383fb h1:p+JeHErfPxRMfF/RF2Dzx23Nr1Q5MQxvS4tvRO7S0X0=
github.com/networkservicemesh/sdk v0.5.1-0.20240812103952-7e0cf2c383fb/go.mod h1:soFR6Mg5LTVvEI0zXNcbWoBnn4hqUK7ItZBQJ3Jbszo=
github.com/networkservicemesh/sdk-k8s v0.0.0-20240808144602-8fb8c883a89f h1:926eUXIDu6drC4VcIxLXxHsynKFYsuHKs28vkXnAuGQ=
github.com/networkservicemesh/sdk-k8s v0.0.0-20240808144602-8fb8c883a89f/go.mod h1:lvKRS5MmkeplIgdNtXQSJAfQSceqJKZSRVIxSsok22g=
github.com/networkservicemesh/sdk-kernel v0.0.0-20240808113656-bf53cf3dc339 h1:nSVShWmyXo/yYB+Fdm1rWL+ZpFkcfDng3zT4HHL88iM=
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Config struct {
OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint" split_words:"true"`
MetricsExportInterval time.Duration `default:"10s" desc:"interval between mertics exports" split_words:"true"`
PprofEnabled bool `default:"false" desc:"is pprof enabled" split_words:"true"`
PprofPort uint16 `default:"6060" desc:"pprof port" split_words:"true"`
PprofListenOn string `default:"localhost:6060" desc:"pprof URL to ListenAndServe" split_words:"true"`

TunnelIP net.IP `desc:"IP to use for tunnels" split_words:"true"`
VxlanPort uint16 `default:"0" desc:"VXLAN port to use" split_words:"true"`
Expand Down
2 changes: 1 addition & 1 deletion internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import (
"github.com/networkservicemesh/sdk/pkg/tools/log/logruslogger"
authmonitor "github.com/networkservicemesh/sdk/pkg/tools/monitorconnection/authorize"
"github.com/networkservicemesh/sdk/pkg/tools/opentelemetry"
"github.com/networkservicemesh/sdk/pkg/tools/pprof"
"github.com/networkservicemesh/sdk/pkg/tools/pprofutils"
"github.com/networkservicemesh/sdk/pkg/tools/spiffejwt"
"github.com/networkservicemesh/sdk/pkg/tools/token"
"github.com/networkservicemesh/sdk/pkg/tools/tracing"
Expand Down Expand Up @@ -154,7 +154,7 @@ func main() {
// Configure pprof
// ********************************************************************************
if cfg.PprofEnabled {
go pprof.Init(ctx, cfg.PprofPort)
go pprofutils.ListenAndServe(ctx, cfg.PprofListenOn)
}

// ********************************************************************************
Expand Down

0 comments on commit 812c3ba

Please sign in to comment.