-
Notifications
You must be signed in to change notification settings - Fork 266
Add AgentTrafficLog functionality for bulk writing and storage #3670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/mini-runtime-container-release
Are you sure you want to change the base?
Add AgentTrafficLog functionality for bulk writing and storage #3670
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 AI Security analysis: "Scanner found no security issues in this change, but absence of findings does not guarantee safety. Seven files were modified—manual review or additional testing is recommended for complex logic, secrets, or dependency updates."
| Risk Level | AI Score |
|---|---|
| 🟢 NO RISK | 5.0/100 |
Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)
| Title | Location | Recommendation |
|---|---|---|
| — | — | No issues to display |
| return Action.SUCCESS.toUpperCase(); | ||
| } | ||
|
|
||
| public String bulkWriteAgentTrafficLogs() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for changes in DbAction for mini-runtime. These actions are for cyborg.
Rather we need to complete the impl in DbActor (which extends DataActor)
| if (params.getRequestParams() != null) { | ||
| log.setApiCollectionId(params.getRequestParams().getApiCollectionId()); | ||
| } | ||
| log.setAccountId(params.getAccountId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync with cyborg here as well
| } | ||
|
|
||
| BasicDBObject obj = new BasicDBObject(); | ||
| obj.put("agentTrafficLogs", agentTrafficLogs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a safety check, we can define some upper limit of payload size, if it exceeds ingest traffic logs in smaller batches.
|
|
||
| public abstract void storeConversationResults(List<AgentConversationResult> conversationResults); | ||
|
|
||
| public abstract void bulkWriteAgentTrafficLogs(List<Object> writesForAgentTrafficLogs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writesForAgentTrafficLogs -> agentTrafficLogs (multiple places)
| * 3. Index on accountId for account-level queries | ||
| * 4. Index on isBlocked for filtering blocked/allowed traffic | ||
| */ | ||
| public void createIndicesIfAbsent() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync with cyborg
| } | ||
|
|
||
| @Override | ||
| public void bulkWriteAgentTrafficLogs(List<Object> writesForAgentTrafficLogs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl in DBActor as well
| SingleTypeInfoDao.instance.createIndicesIfAbsent(); | ||
| SensitiveSampleDataDao.instance.createIndicesIfAbsent(); | ||
| SampleDataDao.instance.createIndicesIfAbsent(); | ||
| AgentTrafficLogDao.instance.createIndicesIfAbsent(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add it to DaoInit as well
No description provided.