From b92e706ce19f256bef679d65ba20c8c5104a73e2 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sun, 28 May 2023 21:31:36 +0800 Subject: [PATCH] chore: refactor (#3295) --- core/trace/agent.go | 1 - core/trace/agent_test.go | 1 + core/trace/config.go | 5 ++--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/trace/agent.go b/core/trace/agent.go index 5823a0a6..efdf1c31 100644 --- a/core/trace/agent.go +++ b/core/trace/agent.go @@ -33,7 +33,6 @@ var ( // StartAgent starts an opentelemetry agent. func StartAgent(c Config) { - if c.Disabled { return } diff --git a/core/trace/agent_test.go b/core/trace/agent_test.go index 36edba21..6101c51d 100644 --- a/core/trace/agent_test.go +++ b/core/trace/agent_test.go @@ -73,6 +73,7 @@ func TestStartAgent(t *testing.T) { StartAgent(c6) StartAgent(c7) StartAgent(c8) + defer StopAgent() lock.Lock() defer lock.Unlock() diff --git a/core/trace/config.go b/core/trace/config.go index d1b32749..5b96a5e0 100644 --- a/core/trace/config.go +++ b/core/trace/config.go @@ -17,7 +17,6 @@ type Config struct { // For example // /v1/traces OtlpHttpPath string `json:",optional"` - - // Disabled indicates whether StartAgent should be called when starting the server. - Disabled bool + // Disabled indicates whether StartAgent starts the agent. + Disabled bool `json:",optional"` }