Skip to content

feat: add EventLoggerService with JSONL and SQL writers#187

Merged
nv-alicheng merged 4 commits intomainfrom
feat/alicheng-event-logger
Mar 18, 2026
Merged

feat: add EventLoggerService with JSONL and SQL writers#187
nv-alicheng merged 4 commits intomainfrom
feat/alicheng-event-logger

Conversation

@nv-alicheng
Copy link
Copy Markdown
Collaborator

  • New EventLoggerService subscribing to ZMQ events
  • JSONLWriter for file-based event logging
  • SQLWriter via SQLAlchemy for DB compatibility
  • Writer base class with async context manager protocol
  • ZMQ context: add socket_dir parameter for configurable IPC paths
  • Add sqlalchemy dependency

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

- Move record.py from async_utils/transport to core/
- Add PromptData, TextModelOutput, ErrorData types with msgspec Struct
- Deprecate str as response_output type in favor of TextModelOutput
- Add msgspec struct performance flags (gc=False, array_like=True)
- Fix threading safety issues in http_client, sample handler, recorder
- Update all imports across the codebase
- Bump default worker init timeout to 60s
@nv-alicheng nv-alicheng requested a review from a team as a code owner March 18, 2026 00:55
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@github-actions github-actions bot requested review from arekay-nv and nvzhihanj March 18, 2026 00:56
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a robust event logging system designed to capture and persist events from ZMQ. It provides flexible storage options, allowing events to be written to either JSONL files or various SQL databases through SQLAlchemy. This enhancement significantly improves the system's ability to monitor and analyze runtime behavior by centralizing event capture and offering adaptable data storage solutions.

Highlights

  • New EventLoggerService: Implemented a new EventLoggerService to subscribe to ZMQ events for centralized logging.
  • JSONL Writer: Introduced JSONLWriter for efficient file-based event logging in JSONL format.
  • SQL Writer via SQLAlchemy: Developed SQLWriter utilizing SQLAlchemy, enabling flexible database compatibility for event persistence (defaulting to SQLite).
  • RecordWriter Base Class: Created a RecordWriter abstract base class, providing a common interface and flush interval logic for event writers.
  • Configurable ZMQ Socket Directory: Enhanced ManagedZMQContext to allow configurable IPC socket paths, improving deployment flexibility.
  • New Dependency: Added sqlalchemy as a new project dependency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an EventLoggerService with JSONL and SQL writers, enhancing the system's event logging capabilities. It includes a new service subscribing to ZMQ events, file and database writers, and updates to dependencies. The code appears well-structured and includes unit tests. However, there are areas where error handling and resource management can be improved to ensure robustness and prevent potential issues.

nv-alicheng and others added 2 commits March 17, 2026 20:41
The SGLang adapter now returns TextModelOutput, not raw str.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- New EventLoggerService subscribing to ZMQ events
- JSONLWriter for file-based event logging
- SQLWriter via SQLAlchemy for DB compatibility
- Writer base class with async context manager protocol
- ZMQ context: add socket_dir parameter for configurable IPC paths
- Add sqlalchemy dependency
@nv-alicheng nv-alicheng force-pushed the feat/alicheng-event-logger branch from a1d6ba4 to b51f11b Compare March 18, 2026 03:43
@nv-alicheng nv-alicheng changed the base branch from feat/alicheng-core-types-refactor to main March 18, 2026 23:23
@nv-alicheng nv-alicheng merged commit 935d055 into main Mar 18, 2026
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants