Skip to content
Merged
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
34 changes: 34 additions & 0 deletions bottlecap/src/traces/trace_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const LLM_OBS_EVAL_METRIC_ENDPOINT_PATH_V2: &str =
const LLM_OBS_SPANS_ENDPOINT_PATH: &str = "/evp_proxy/v2/api/v2/llmobs";
const DD_ADDITIONAL_TAGS_HEADER: &str = "X-Datadog-Additional-Tags";
const INFO_ENDPOINT_PATH: &str = "/info";
const DEBUGGER_ENDPOINT_PATH: &str = "/debugger/v1/input";
const DEBUGGER_LOGS_INTAKE_PATH: &str = "/api/v2/logs";
const TRACER_PAYLOAD_CHANNEL_BUFFER_SIZE: usize = 10;
const STATS_PAYLOAD_CHANNEL_BUFFER_SIZE: usize = 10;
pub const MAX_CONTENT_LENGTH: usize = 10 * 1024 * 1024;
Expand Down Expand Up @@ -338,6 +340,17 @@ impl TraceAgent {
StatusCode::INTERNAL_SERVER_ERROR,
),
},
(&Method::POST, DEBUGGER_ENDPOINT_PATH) => {
match Self::handle_debugger_logs_proxy(config, tags_provider, api_key, client, req)
.await
{
Ok(result) => Ok(result),
Err(err) => log_and_create_http_response(
&format!("Debugger logs endpoint error: {err}"),
StatusCode::INTERNAL_SERVER_ERROR,
),
}
}
_ => {
let mut not_found = Response::default();
*not_found.status_mut() = StatusCode::NOT_FOUND;
Expand Down Expand Up @@ -458,6 +471,7 @@ impl TraceAgent {
LLM_OBS_EVAL_METRIC_ENDPOINT_PATH,
LLM_OBS_EVAL_METRIC_ENDPOINT_PATH_V2,
LLM_OBS_SPANS_ENDPOINT_PATH,
DEBUGGER_ENDPOINT_PATH,
],
"client_drop_p0s": true,
}
Expand Down Expand Up @@ -650,6 +664,26 @@ impl TraceAgent {
.await
}

async fn handle_debugger_logs_proxy(
config: Arc<config::Config>,
tags_provider: Arc<provider::Provider>,
api_key: String,
client: reqwest::Client,
req: hyper_migration::HttpRequest,
) -> http::Result<hyper_migration::HttpResponse> {
Self::handle_proxy(
config,
client,
api_key,
tags_provider,
req,
"http-intake.logs",
DEBUGGER_LOGS_INTAKE_PATH,
"debugger_logs",
)
.await
}

#[must_use]
pub fn get_sender_copy(&self) -> Sender<SendData> {
self.tx.clone()
Expand Down
Loading