-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Currently, Argus stores events only in memory with limited buffer size (65,536 events). When the buffer fills up or the application restarts:
- Historical data is lost
- Cannot analyze patterns over time
- No way to compare performance across sessions
Proposed Solution
Integrate DuckDB (embedded analytical database) for event persistence:
- Store all events to local DuckDB file
- Enable time-range queries for historical analysis
- Support data retention policies
- Allow export to Parquet files for external analysis
Acceptance Criteria
- Add DuckDB dependency to argus-server
- Create schema for virtual thread events
- Persist events asynchronously (non-blocking)
- Add
/historyAPI endpoint with time-range filtering - Implement data retention (configurable, default 7 days)
- Add dashboard section for historical trends
- Support
-Dargus.persistence.enabled=trueflag
Technical Considerations
- DuckDB is embedded (no external server needed)
- Use batch inserts for performance (every 1000 events or 1 second)
- Consider WAL mode for durability vs performance trade-off
- File location:
~/.argus/data/events.duckdb
Schema Design
CREATE TABLE virtual_thread_events (
id BIGINT PRIMARY KEY,
timestamp TIMESTAMP,
event_type VARCHAR(32),
thread_id BIGINT,
thread_name VARCHAR(256),
carrier_thread BIGINT,
stack_trace TEXT,
duration_ns BIGINT
);
CREATE INDEX idx_timestamp ON virtual_thread_events(timestamp);
CREATE INDEX idx_thread_id ON virtual_thread_events(thread_id);
CREATE INDEX idx_event_type ON virtual_thread_events(event_type);API Design
GET /history?from=2024-01-01T00:00:00Z&to=2024-01-02T00:00:00Z&type=PINNED
{
"query": { "from": "...", "to": "...", "type": "PINNED" },
"totalEvents": 15234,
"events": [ ... ]
}Configuration
argus.persistence.enabled=true
argus.persistence.path=~/.argus/data
argus.persistence.retention-days=7
argus.persistence.batch-size=1000Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request