Skip to content

Commit

Permalink
refactor: Simplify metrics and pprof server address formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattevans committed Jan 9, 2025
1 parent 7b3fb0d commit a9286ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/sentry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ func (s *contributoor) startMetricsServer() error {
sm.Handle("/metrics", promhttp.Handler())

var (
metricsHost, metricsPort = s.config.GetMetricsHostPort()
addr = fmt.Sprintf("%s:%s", metricsHost, metricsPort)
_, metricsPort = s.config.GetMetricsHostPort()
addr = fmt.Sprintf(":%s", metricsPort)
)

s.metricsServer = &http.Server{
Expand All @@ -220,7 +220,7 @@ func (s *contributoor) startPProfServer() error {
return nil
}

var addr = fmt.Sprintf("%s:%s", pprofHost, pprofPort)
var addr = fmt.Sprintf(":%s", pprofPort)

s.pprofServer = &http.Server{
Addr: addr,
Expand Down

0 comments on commit a9286ea

Please sign in to comment.