api: log ingress request ids
This commit is contained in:
@@ -38,6 +38,7 @@ use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Value, json};
|
||||
use sha2::{Digest, Sha256};
|
||||
use time::{OffsetDateTime, format_description::well_known::Rfc3339};
|
||||
use tracing::info;
|
||||
|
||||
use crate::{
|
||||
catalog::PublishedToolCatalog,
|
||||
@@ -240,6 +241,13 @@ async fn mcp_post(
|
||||
Json(message): Json<Value>,
|
||||
) -> Response {
|
||||
let transport_request_id = resolve_request_id(&headers);
|
||||
info!(
|
||||
request_id = %transport_request_id,
|
||||
workspace_slug = %path.workspace_slug,
|
||||
agent_slug = %path.agent_slug,
|
||||
jsonrpc_method = method_name(&message).unwrap_or("<unknown>"),
|
||||
"mcp request received"
|
||||
);
|
||||
|
||||
if let Err(status) = validate_origin(&state.allowed_origins, &headers) {
|
||||
return with_request_id_header(status.into_response(), &transport_request_id);
|
||||
|
||||
Reference in New Issue
Block a user