openviking/storage/observers/README.md
The observers module provides observability capabilities for the OpenViking storage system. Observers allow monitoring and reporting the status of various storage components in real-time.
All observers inherit from BaseObserver, which defines the common interface:
from openviking.storage.observers import BaseObserver
class MyObserver(BaseObserver):
def get_status_table(self) -> str:
"""Format status information as a string."""
def is_healthy(self) -> bool:
"""Check if observed system is healthy."""
def has_errors(self) -> bool:
"""Check if observed system has any errors."""
Monitors queue system status (Embedding, Semantic, and custom queues).
Location: openviking/storage/observers/queue_observer.py
Usage:
import openviking as ov
client = ov.OpenViking(path="./data")
print(client.observer.queue)
# Output:
# Queue Pending In Progress Processed Errors Total
# Embedding 5 2 100 0 107
# Semantic 3 1 95 1 99
# TOTAL 8 3 195 1 206
Monitors VikingDB collection status (index count and vector count per collection).
Location: openviking/storage/observers/vikingdb_observer.py
Usage:
import openviking as ov
client = ov.OpenViking(path="./data")
print(client.observer.vikingdb())
# Output:
# Collection Index Count Vector Count Status
# context 1 69 OK
# TOTAL 1 69
get_status_table() for human-readable output: Provides clean, formatted tablesOpenViking and AsyncOpenViking