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"` }