Skip to content

Releases: tobilg/ai-observer

v0.3.0

26 Jan 23:26

Choose a tag to compare

v0.2.0

04 Jan 19:25

Choose a tag to compare

AI Observer v0.2.0 Release Notes

Highlights

This release transforms AI Observer from a real-time telemetry receiver into a complete observability solution with historical data import, data export to Parquet, and embedded pricing for 67+ AI models. You can now import past sessions from Claude Code, Gemini CLI, and Codex CLI local files, calculate accurate costs retroactively, and export your telemetry data in portable formats for archiving or sharing.

New Features

Historical Session Import (ai-observer import)

Import past session data from local AI tool files directly into AI Observer with automatic cost calculation:

ai-observer import claude-code --from 2025-01-01 --to 2025-12-31
ai-observer import all  # Import from all supported tools
  • Claude Code: Reads ~/.claude/projects/**/*.jsonl files
  • Codex CLI: Reads ~/.codex/sessions/*.jsonl files
  • Gemini CLI: Reads ~/.gemini/tmp/**/session-*.json files

Features include:

  • Date range filtering with --from and --to
  • Dry-run mode to preview imports without changes
  • Force re-import of already-processed files
  • Purge existing data in time range before importing
  • State tracking to avoid duplicate imports

Data Export to Parquet (ai-observer export)

Export telemetry data to portable Parquet files with an optional DuckDB views database:

ai-observer export all --output ./export
ai-observer export claude-code --output ./export --zip  # Create ZIP archive
ai-observer export all --output ./export --from-files   # Export directly from raw files

Generates:

  • traces.parquet, logs.parquet, metrics.parquet files
  • A DuckDB views database for easy querying with relative paths
  • Optional ZIP archive for sharing

Data Deletion (ai-observer delete)

Delete telemetry data by time range and optionally by service:

ai-observer delete all --from 2025-01-01 --to 2025-01-31
ai-observer delete logs --from 2025-01-01 --to 2025-01-31 --service claude-code

Embedded Pricing System

Cost calculation for 67+ models across three providers with embedded JSON pricing data:

  • Claude: 21 models including claude-sonnet-4, claude-opus-4, claude-3.5-sonnet, haiku variants
  • Codex/OpenAI: 28 models including gpt-4.1, o3, o4-mini, codex-mini
  • Gemini: 18 models including gemini-2.5-pro, gemini-2.0-flash, gemini-exp series

The pricing system handles:

  • Per-million token pricing for input, output, cache creation, and cache read
  • Model name normalization (maps variants like claude-3-5-sonnet-20241022 to canonical names)
  • Automatic cost calculation during import

User-Facing Token Metrics for Claude Code

New derived metrics that filter out internal tool-routing API calls to match what users see in billing:

  • claude_code.token.usage_user_facing - Tokens from user-facing API calls only
  • claude_code.cost.usage_user_facing - Cost from user-facing API calls only

These metrics exclude API calls that have no cache tokens (tool-routing calls), providing counts that match tools like ccusage.

Dashboard Export & Import

Export and import dashboard configurations via the UI:

  • Export dashboards to JSON files for backup or sharing
  • Import dashboards from JSON files or URLs
  • Preserves widget configurations, positions, and settings

Enhanced Date Range Picker

New date range picker component in the UI with:

  • Calendar-based date selection
  • Preset ranges (Last 24h, Last 7d, Last 30d, etc.)
  • Custom date range support
  • Applied across Traces, Metrics, and Logs pages

Setup Command

New ai-observer setup command to display configuration instructions:

ai-observer setup claude-code  # Show Claude Code setup
ai-observer setup gemini       # Show Gemini CLI setup
ai-observer setup codex        # Show Codex CLI setup

Improvements

CLI Architecture Overhaul

The CLI now uses a subcommand architecture instead of flags:

  • ai-observer serve - Start the OTLP server (default when no command)
  • ai-observer import - Import historical data
  • ai-observer export - Export to Parquet
  • ai-observer delete - Delete data by time range
  • ai-observer setup - Show tool setup instructions

Configurable Log Level

New AI_OBSERVER_LOG_LEVEL environment variable to control logging verbosity:

  • Supports DEBUG, INFO, WARN, ERROR
  • Defaults to INFO

Metric Chart Improvements

  • Line charts now support area fill display
  • Bar charts show proper stacking for multi-series data
  • Improved legend and tooltip formatting
  • Better handling of sparse time series data

Dashboard Widget Enhancements

  • Metric chart widgets now support configurable intervals and aggregation modes
  • Widget titles properly reflect the selected metric and configuration
  • Improved responsive grid layout

Bug Fixes

Gemini Metrics Delta Calculation

Fixed delta metric computation for Gemini CLI cumulative counters. The backend now properly tracks previous values per metric name and attributes to compute per-interval deltas.

Codex Metrics Extraction

Improved token and cost metric extraction from Codex CLI logs, properly parsing the usage field from api_request events.

Technical Changes

New Backend Packages

  • internal/importer/ - Historical data import logic with parsers for each AI tool
  • internal/exporter/ - Parquet export, views database generation, and ZIP creation
  • internal/deleter/ - Time-range based data deletion
  • internal/pricing/ - Embedded pricing data and cost calculation
  • internal/tools/ - Service name normalization utilities

Storage Layer Extensions

  • import_state table tracks imported files to prevent duplicates
  • DeleteByTimeRange methods on all stores (traces, logs, metrics)
  • CreateParquetExport method for direct Parquet file generation

Frontend Dependencies

  • Added date-fns for date manipulation
  • Added react-day-picker for calendar components
  • New shadcn/ui components: calendar, date-range-picker, popover

Test Coverage

Comprehensive test suites added for:

  • CLI command parsing and validation
  • Import/export functionality
  • Pricing calculations
  • Delete operations
  • Dashboard export/import logic

Full Changelog: v0.1.0...v0.2.0

v0.1.0

01 Jan 19:37

Choose a tag to compare

This is the first release! Happy for any feedback!

Full Changelog: https://github.com/tobilg/ai-observer/commits/v0.1.0