Fix missing log entry on Duo Chat v2 endpoint
What does this MR do and why?
It was observed that the Received an event from v2/chat/agent
was missing from the logs when the user had expanded_ai_logging
enabled, but not when they had it disabled.
This is because the custom options
are only passed from the Gitlab::Llm::Logger#conditional_info
method to the logger when the feature flag is enabled.
The event
option was conflicting with the existing event
field in the Elastic Search node for Sidekiq.
I searched for other uses of conditional_info
to see if they had the same problem, but I did not find any.
MR acceptance checklist
Screenshots or screen recordings
How to set up and validate locally
- Enable v2 endpoint feature flag in rails console
Feature.enable(:v2_chat_agent_integration)
- Enable LLM logging
- Ask any question to Duo Chat
- Look in the logs
- Note that the
Received a chunk from v2/chat/agent
event has anai_event
listed now, not justevent
Related to #494161 (closed)
Edited by Lesley Razzaghian