diff --git a/src/server/server_impl.go b/src/server/server_impl.go index 955969e0..0ac99a30 100644 --- a/src/server/server_impl.go +++ b/src/server/server_impl.go @@ -235,7 +235,7 @@ func newServer(s settings.Settings, name string, statsManager stats.Manager, loc ret.router = mux.NewRouter() // setup healthcheck path - ret.health = NewHealthChecker(health.NewServer(), "ratelimit", s.HealthyWithAtLeastOneConfigLoaded) + ret.health = NewHealthChecker(health.NewServer(), name, s.HealthyWithAtLeastOneConfigLoaded) ret.router.Path("/healthcheck").Handler(ret.health) healthpb.RegisterHealthServer(ret.grpcServer, ret.health.Server()) diff --git a/src/service_cmd/main.go b/src/service_cmd/main.go index e631e0e6..74034949 100644 --- a/src/service_cmd/main.go +++ b/src/service_cmd/main.go @@ -6,6 +6,6 @@ import ( ) func main() { - runner := runner.NewRunner(settings.NewSettings()) + runner := runner.NewRunner("ratelimit", settings.NewSettings()) runner.Run() } diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index 8867a0b3..5da2e0c2 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -31,14 +31,16 @@ import ( ) type Runner struct { + name string statsManager stats.Manager settings settings.Settings srv server.Server mu sync.Mutex } -func NewRunner(s settings.Settings) Runner { +func NewRunner(name string, s settings.Settings) Runner { return Runner{ + name: name, statsManager: stats.NewStatManager(gostats.NewDefaultStore(), s), settings: s, } @@ -111,7 +113,7 @@ func (runner *Runner) Run() { serverReporter := metrics.NewServerReporter(runner.statsManager.GetStatsStore().ScopeWithTags("ratelimit_server", s.ExtraTags)) - srv := server.NewServer(s, "ratelimit", runner.statsManager, localCache, settings.GrpcUnaryInterceptor(serverReporter.UnaryServerInterceptor())) + srv := server.NewServer(s, runner.name, runner.statsManager, localCache, settings.GrpcUnaryInterceptor(serverReporter.UnaryServerInterceptor())) runner.mu.Lock() runner.srv = srv runner.mu.Unlock() diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index ff411c4f..aaa0e265 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -694,7 +694,7 @@ func testBasicBaseConfig(s settings.Settings) func(*testing.T) { func startTestRunner(t *testing.T, s settings.Settings) *runner.Runner { t.Helper() - runner := runner.NewRunner(s) + runner := runner.NewRunner("ratelimit", s) go func() { // Catch a panic() to ensure that test name is printed.