api: propagate request ids through admin test runs
This commit is contained in:
@@ -594,6 +594,7 @@ struct InvocationRecordRequest<'a> {
|
||||
workspace_id: &'a WorkspaceId,
|
||||
agent_id: Option<&'a AgentId>,
|
||||
operation: &'a RegistryOperation,
|
||||
request_id: Option<&'a str>,
|
||||
source: InvocationSource,
|
||||
level: InvocationLevel,
|
||||
status: InvocationStatus,
|
||||
@@ -2093,6 +2094,7 @@ impl AdminService {
|
||||
workspace_id: &WorkspaceId,
|
||||
operation_id: &OperationId,
|
||||
payload: TestRunPayload,
|
||||
request_id: &str,
|
||||
) -> Result<TestRunResult, ApiError> {
|
||||
let record = self
|
||||
.get_operation_version(workspace_id, operation_id, payload.version)
|
||||
@@ -2112,6 +2114,7 @@ impl AdminService {
|
||||
workspace_id,
|
||||
agent_id: None,
|
||||
operation: &record.snapshot,
|
||||
request_id: Some(request_id),
|
||||
source: InvocationSource::AdminTestRun,
|
||||
level: InvocationLevel::Error,
|
||||
status: InvocationStatus::Error,
|
||||
@@ -2180,6 +2183,7 @@ impl AdminService {
|
||||
workspace_id,
|
||||
agent_id: None,
|
||||
operation: &record.snapshot,
|
||||
request_id: Some(request_id),
|
||||
source: InvocationSource::AdminTestRun,
|
||||
level: InvocationLevel::Info,
|
||||
status: InvocationStatus::Ok,
|
||||
@@ -2209,6 +2213,7 @@ impl AdminService {
|
||||
workspace_id,
|
||||
agent_id: None,
|
||||
operation: &record.snapshot,
|
||||
request_id: Some(request_id),
|
||||
source: InvocationSource::AdminTestRun,
|
||||
level: InvocationLevel::Error,
|
||||
status: InvocationStatus::Error,
|
||||
@@ -4194,6 +4199,7 @@ impl AdminService {
|
||||
workspace_id,
|
||||
agent_id: Some(revops_agent_id),
|
||||
operation: &rest_operation.snapshot,
|
||||
request_id: None,
|
||||
source: InvocationSource::AgentToolCall,
|
||||
level: InvocationLevel::Info,
|
||||
status: InvocationStatus::Ok,
|
||||
@@ -4216,6 +4222,7 @@ impl AdminService {
|
||||
workspace_id,
|
||||
agent_id: Some(revops_agent_id),
|
||||
operation: &graphql_operation.snapshot,
|
||||
request_id: None,
|
||||
source: InvocationSource::AgentToolCall,
|
||||
level: InvocationLevel::Info,
|
||||
status: InvocationStatus::Ok,
|
||||
@@ -4238,6 +4245,7 @@ impl AdminService {
|
||||
workspace_id,
|
||||
agent_id: Some(revops_agent_id),
|
||||
operation: &graphql_operation.snapshot,
|
||||
request_id: None,
|
||||
source: InvocationSource::AgentToolCall,
|
||||
level: InvocationLevel::Error,
|
||||
status: InvocationStatus::Error,
|
||||
@@ -4262,6 +4270,7 @@ impl AdminService {
|
||||
workspace_id,
|
||||
agent_id: None,
|
||||
operation: &grpc_operation.snapshot,
|
||||
request_id: None,
|
||||
source: InvocationSource::AdminTestRun,
|
||||
level: InvocationLevel::Info,
|
||||
status: InvocationStatus::Ok,
|
||||
@@ -4298,7 +4307,7 @@ impl AdminService {
|
||||
status: request.status,
|
||||
tool_name: request.operation.name.clone(),
|
||||
message: request.message,
|
||||
request_id: None,
|
||||
request_id: request.request_id.map(ToOwned::to_owned),
|
||||
status_code: request.status_code,
|
||||
duration_ms: request.duration_ms,
|
||||
error_kind: request.error_kind,
|
||||
|
||||
Reference in New Issue
Block a user