瀏覽代碼

chore: refactor (#3295)

Kevin Wan 1 年之前
父節點
當前提交
b92e706ce1
共有 3 個文件被更改,包括 3 次插入4 次删除
  1. 0 1
      core/trace/agent.go
  2. 1 0
      core/trace/agent_test.go
  3. 2 3
      core/trace/config.go

+ 0 - 1
core/trace/agent.go

@@ -33,7 +33,6 @@ var (
 
 // StartAgent starts an opentelemetry agent.
 func StartAgent(c Config) {
-
 	if c.Disabled {
 		return
 	}

+ 1 - 0
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()

+ 2 - 3
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"`
 }