Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public EvalProcessingWorker(

Headers headers;
HttpUrl submissionUrl;
OkHttpClient httpClient;
if (isAgentless) {
submissionUrl =
HttpUrl.get(
Expand All @@ -63,17 +64,22 @@ public EvalProcessingWorker(
+ "/"
+ EVAL_METRIC_API_PATH);
headers = Headers.of(DD_API_KEY_HEADER_NAME, config.getApiKey());
httpClient = sco.getIntakeHttpClient();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep HTTPS eval submissions off the cleartext intake client

When DD_FORCE_CLEAR_TEXT_HTTP_FOR_INTAKE_CLIENT is enabled, getIntakeHttpClient() builds the shared intake client as cleartext-only via OkHttpUtils.buildHttpClient, but the agentless eval URL above is still hard-coded to https://api.<site>/.... OkHttp rejects HTTPS requests on a ConnectionSpec.CLEARTEXT-only client, so enabling that supported intake flag for another backend intake now disables LLMObs agentless eval submissions; use an HTTPS-capable client for HTTPS eval URLs or honor the configured LLMObs agentless URL before sharing this client.

Useful? React with 👍 / 👎.

} else {
submissionUrl =
HttpUrl.get(
sco.agentUrl.toString()
+ DDAgentFeaturesDiscovery.V2_EVP_PROXY_ENDPOINT
+ EVAL_METRIC_API_PATH);
headers = Headers.of(EVP_SUBDOMAIN_HEADER_NAME, EVAL_METRIC_API_DOMAIN);
// For a UDS or named pipe Agent, `agentUrl` is only a placeholder and the socket transport
// lives on the shared client, so a client of our own would never reach the Agent.
httpClient = sco.agentHttpClient;
}

EvalSerializingHandler serializingHandler =
new EvalSerializingHandler(queue, flushInterval, timeUnit, submissionUrl, headers);
new EvalSerializingHandler(
queue, flushInterval, timeUnit, submissionUrl, headers, httpClient);
this.serializerThread = newAgentThread(LLMOBS_EVALS_PROCESSOR, serializingHandler);
}

Expand Down Expand Up @@ -116,12 +122,13 @@ public EvalSerializingHandler(
final long flushInterval,
final TimeUnit timeUnit,
final HttpUrl submissionUrl,
final Headers headers) {
final Headers headers,
final OkHttpClient httpClient) {
this.queue = queue;
this.moshi = new Moshi.Builder().add(LLMObsEval.class, new LLMObsEval.Adapter()).build();

this.evalJsonAdapter = moshi.adapter(LLMObsEval.Request.class);
this.httpClient = new OkHttpClient();
this.httpClient = httpClient;
this.submissionUrl = submissionUrl;
this.headers = headers;

Expand Down
Loading