66
77/** Main configuration for CozeLoop Client. */
88public class CozeLoopConfig {
9+ private static final String DEFAULT_TRACE_PATH = "/v1/loop/opentelemetry/v1/traces" ;
10+
911 private String workspaceId = System .getenv ("COZELOOP_WORKSPACE_ID" );
1012 private String serviceName = "cozeloop-java-app" ;
1113 private String baseUrl = "https://api.coze.cn" ;
14+ private String tracePath = DEFAULT_TRACE_PATH ;
1215
1316 private HttpConfig httpConfig ;
1417 private CozeLoopTracerProvider .TraceConfig traceConfig ;
@@ -45,6 +48,14 @@ public void setBaseUrl(String baseUrl) {
4548 this .baseUrl = baseUrl ;
4649 }
4750
51+ public String getTracePath () {
52+ return tracePath ;
53+ }
54+
55+ public void setTracePath (String tracePath ) {
56+ this .tracePath = tracePath ;
57+ }
58+
4859 public HttpConfig getHttpConfig () {
4960 return httpConfig ;
5061 }
@@ -71,7 +82,7 @@ public void setPromptCacheConfig(PromptCache.PromptCacheConfig promptCacheConfig
7182
7283 /** Get span endpoint URL. */
7384 public String getSpanEndpoint () {
74- return baseUrl + "/v1/loop/opentelemetry/v1/traces" ;
85+ return baseUrl + tracePath ;
7586 }
7687
7788 /** Get prompt endpoint URL for fetching prompts (mget). */
@@ -111,6 +122,11 @@ public Builder baseUrl(String baseUrl) {
111122 return this ;
112123 }
113124
125+ public Builder tracePath (String tracePath ) {
126+ config .tracePath = tracePath ;
127+ return this ;
128+ }
129+
114130 public Builder httpConfig (HttpConfig httpConfig ) {
115131 config .httpConfig = httpConfig ;
116132 return this ;
0 commit comments