public class CozeLoopClientBuilder extends Object
| Constructor and Description |
|---|
CozeLoopClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
CozeLoopClientBuilder |
auth(Auth auth)
Use custom authentication.
|
CozeLoopClientBuilder |
baseUrl(String baseUrl)
Set base URL (optional, default: "https://api.coze.cn").
|
CozeLoopClient |
build()
Build the CozeLoopClient instance.
|
CozeLoopClientBuilder |
config(CozeLoopConfig config)
Set configuration (optional).
|
CozeLoopClientBuilder |
finishEventProcessor(FinishEventProcessor processor)
Set finish event processor for span finish events.
|
CozeLoopClientBuilder |
jwtOAuth(String clientId,
String privateKey,
String publicKeyId)
Use JWT OAuth authentication.
|
CozeLoopClientBuilder |
maxSpanExportBatchSize(int size)
Set maximum span export batch size (default: 100).
|
CozeLoopClientBuilder |
maxSpanExportQueueSize(int size)
Set maximum span queue size (default: 1024).
|
CozeLoopClientBuilder |
serviceName(String serviceName)
Set service name (optional, default: "cozeloop-java-app").
|
CozeLoopClientBuilder |
spanExportScheduleDelay(long delayMillis)
Set schedule delay between batch exports in milliseconds (default: 1000).
|
CozeLoopClientBuilder |
spanExportTimeout(long timeoutMillis)
Set span exporter timeout in milliseconds (default: 3000).
|
CozeLoopClientBuilder |
tokenAuth(String token)
Use token authentication.
|
CozeLoopClientBuilder |
tracePath(String tracePath)
Set trace path (optional, default: "/v1/loop/opentelemetry/v1/traces").
|
CozeLoopClientBuilder |
workspaceId(String workspaceId)
Set workspace ID (required).
|
public CozeLoopClientBuilder workspaceId(String workspaceId)
workspaceId - the workspace IDpublic CozeLoopClientBuilder serviceName(String serviceName)
serviceName - the service namepublic CozeLoopClientBuilder baseUrl(String baseUrl)
baseUrl - the base URLpublic CozeLoopClientBuilder tracePath(String tracePath)
tracePath - the trace pathpublic CozeLoopClientBuilder config(CozeLoopConfig config)
config - the configurationpublic CozeLoopClientBuilder tokenAuth(String token)
token - the access tokenpublic CozeLoopClientBuilder jwtOAuth(String clientId, String privateKey, String publicKeyId)
clientId - the client IDprivateKey - the private key (PEM format)publicKeyId - the public key IDpublic CozeLoopClientBuilder auth(Auth auth)
auth - the authentication providerpublic CozeLoopClientBuilder finishEventProcessor(FinishEventProcessor processor)
processor - the finish event processorpublic CozeLoopClientBuilder maxSpanExportQueueSize(int size)
size - maximum queue sizepublic CozeLoopClientBuilder maxSpanExportBatchSize(int size)
size - maximum batch sizepublic CozeLoopClientBuilder spanExportTimeout(long timeoutMillis)
timeoutMillis - timeout in millisecondspublic CozeLoopClientBuilder spanExportScheduleDelay(long delayMillis)
delayMillis - delay in millisecondspublic CozeLoopClient build()
Copyright © 2026. All rights reserved.