Skip to content
代码片段 群组 项目
未验证 提交 7d45055d 编辑于 作者: Furkan Ayhan's avatar Furkan Ayhan 提交者: GitLab
浏览文件

Merge branch 'log-v2-error-message-and-origin' into 'master'

Add response server in step executor error log

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/168010



Merged-by: default avatarFurkan Ayhan <furkanayhn@gmail.com>
Approved-by: default avatarTetiana Chupryna <tchupryna@gitlab.com>
Approved-by: default avatarFurkan Ayhan <furkanayhn@gmail.com>
Co-authored-by: default avatarShinya Maeda <shinya@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -124,8 +124,16 @@ def perform_agent_request(params)
return
end
log_error(message: "Received error from Duo Chat Agent", event_name: 'error_returned',
ai_component: 'duo_chat', status: response.code)
# Requests could fail at intermediate servers between GitLab-Sidekiq and AI Gateway.
# Here are the list of servers that could intervene:
# - Cloud Connector Cloud Flare
# - GCP Cloud Run ingress / autoscaler
# See https://gitlab.com/groups/gitlab-org/-/epics/15402 for more information.
log_error(message: "Failed to request to v2/chat/agent",
event_name: 'error_returned',
ai_component: 'duo_chat',
status: response.code,
ai_response_server: response.headers['server'])
# TODO: Improve error handling
raise Gitlab::AiGateway::ForbiddenError if response.forbidden?
......
......@@ -15,7 +15,7 @@
}
end
let(:response) { instance_double(HTTParty::Response) }
let(:response) { instance_double(HTTParty::Response, headers: {}) }
before do
allow(response).to receive(:success?).and_return(true)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册