Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ tmp/
# Testing artifacts
testdata/output/

# Web dashboard
web/node_modules/
web/dist/

# Claude Code settings
.claude/settings.local.json
result
59 changes: 51 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ PURPLE := \033[0;35m
CYAN := \033[0;36m
NC := \033[0m # No Color

.PHONY: all build clean clean-all test test-race test-integration \
# Code signing (macOS) — set via environment or here
CODESIGN_IDENTITY ?= -

.PHONY: all build build-tui clean clean-all test test-race test-integration \
fmt vet lint install uninstall run demo \
deps deps-update deps-tidy cross-build release help dev ci info
deps deps-update deps-tidy cross-build release help dev ci info \
web-deps web-build web-dev web-clean build-signed

# Default target
all: clean build
Expand All @@ -53,16 +57,54 @@ help: ## Show this help message
@echo " make cross-build # Build for all platforms"
@echo " make install # Install to GOPATH/bin"

# Web dashboard targets
web-deps: ## Install web dashboard dependencies
@echo "$(BLUE)Installing web dependencies...$(NC)"
@cd web && rm -rf node_modules && npm ci
@echo "$(GREEN)✓ Web dependencies installed$(NC)"

web-build: web-deps ## Build web dashboard
@echo "$(BLUE)Building web dashboard...$(NC)"
@cd web && npm run build
@echo "$(GREEN)✓ Web dashboard built$(NC)"

web-dev: web-deps ## Start web dev server with API proxy
@echo "$(BLUE)Starting web dev server...$(NC)"
@cd web && npm run dev

web-clean: ## Clean web build artifacts
@echo "$(BLUE)Cleaning web artifacts...$(NC)"
@rm -rf web/dist web/node_modules
@echo "$(GREEN)✓ Web artifacts cleaned$(NC)"

# Ensure web/dist exists for go:embed (stub if not built)
ensure-web-dist:
@mkdir -p web/dist
@test -f web/dist/index.html || echo '<!DOCTYPE html><html><body></body></html>' > web/dist/index.html

# Build targets
build: deps ## Build the TUI binary
@echo "$(BLUE)Building TUI version...$(NC)"
build: deps web-build ## Build binary with embedded web dashboard
@echo "$(BLUE)Building Gonzo with web dashboard...$(NC)"
@mkdir -p $(BUILD_DIR)
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) \
$(GO) build $(BUILD_FLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) $(CMD_DIR)
@echo "$(GREEN)✓ Built $(BUILD_DIR)/$(BINARY_NAME)$(NC)"

build-signed: build ## Build and codesign for macOS (set CODESIGN_IDENTITY for distribution)
@echo "$(BLUE)Signing $(BUILD_DIR)/$(BINARY_NAME)...$(NC)"
@codesign --force --options runtime --sign "$(CODESIGN_IDENTITY)" --timestamp $(BUILD_DIR)/$(BINARY_NAME)
@echo "$(GREEN)✓ Signed $(BUILD_DIR)/$(BINARY_NAME)$(NC)"
@codesign -dvv $(BUILD_DIR)/$(BINARY_NAME) 2>&1 | head -5

build-tui: deps ensure-web-dist ## Build TUI-only binary (placeholder web dashboard)
@echo "$(BLUE)Building TUI-only version...$(NC)"
@mkdir -p $(BUILD_DIR)
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) \
$(GO) build $(BUILD_FLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) $(CMD_DIR)
@echo "$(GREEN)✓ Built $(BUILD_DIR)/$(BINARY_NAME) (TUI only)$(NC)"

# Cross-platform builds
cross-build: clean deps ## Build for multiple platforms
cross-build: clean deps ensure-web-dist ## Build for multiple platforms
@echo "$(BLUE)Building for multiple platforms...$(NC)"
@mkdir -p $(DIST_DIR)

Expand Down Expand Up @@ -108,11 +150,11 @@ deps-tidy: ## Clean up dependencies
@$(GO) mod tidy

# Testing
test: deps ## Run tests
test: deps ensure-web-dist ## Run tests
@echo "$(BLUE)Running tests...$(NC)"
@$(GO) test -v ./...

test-race: deps ## Run tests with race detection
test-race: deps ensure-web-dist ## Run tests with race detection
@echo "$(BLUE)Running tests with race detection...$(NC)"
@$(GO) test -race -v ./...

Expand Down Expand Up @@ -142,7 +184,7 @@ fmt: ## Format code
@echo "$(BLUE)Formatting code...$(NC)"
@$(GO) fmt ./...

vet: ## Run go vet
vet: ensure-web-dist ## Run go vet
@echo "$(BLUE)Running go vet...$(NC)"
@$(GO) vet ./...

Expand Down Expand Up @@ -211,6 +253,7 @@ clean: ## Clean build artifacts
@echo "$(BLUE)Cleaning build artifacts...$(NC)"
@rm -rf $(BUILD_DIR)
@rm -rf $(DIST_DIR)
@rm -rf web/dist
@rm -f $(BINARY_NAME)
@echo "$(GREEN)✓ Cleaned$(NC)"

Expand Down
61 changes: 57 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ Here are some references to get you started:
- **Log Counts analysis** - Detailed modal with heatmap visualization, pattern analysis by severity, and service distribution
- **AI analysis** - Get intelligent insights about log patterns and anomalies with configurable models

### 🌐 Web Dashboard (Dstl8 Lite)

- **Embedded React UI** - Full web dashboard served directly from the Gonzo binary (no external dependencies)
- **Real-time updates** - WebSocket-powered live streaming with 1-second refresh
- **Severity distribution** - Interactive time-series severity charts with stream-level filtering
- **Sentiment heatmap** - Color-coded heatmap visualization grouped by pod, namespace, service, host, or deployment
- **Pattern analysis** - Drain3-powered log pattern detection and classification
- **Log viewer** - Searchable, auto-scrolling log viewer with click-to-expand details
- **Source browser** - Explore log sources with dimension breakdowns
- **Light/dark mode** - Automatic theme support

### 🔍 Advanced Filtering

- **Regex support** - Filter logs with regular expressions
Expand Down Expand Up @@ -306,6 +317,30 @@ export OPENAI_API_KEY=sk-your-key-here
cat logs.json | gonzo --ai-model="gpt-4"
```

### Web Dashboard (Dstl8 Lite)

Gonzo includes an embedded web dashboard that runs alongside the TUI. It starts automatically on port 5718.

```bash
# Gonzo starts the web dashboard automatically
gonzo -f application.log --follow
# Open http://localhost:5718 in your browser

# Use a custom port
gonzo -f application.log --web-port=3000

# Disable the web dashboard
gonzo -f application.log --web-disabled
```

The dashboard includes:
- **Workspaces** - Overview of all active log streams with sparkline previews
- **Stream Details** - Severity distribution, top attributes, pattern analysis, and live log viewer per stream
- **Sentiment Heatmap** - Real-time heatmap grouped by pod, namespace, service, host, or deployment with auto-detection of available dimensions
- **Sources** - Browse log sources with dimension breakdowns

All data updates in real-time via WebSocket, matching what you see in the TUI.

### Keyboard Shortcuts

#### Navigation
Expand Down Expand Up @@ -452,6 +487,10 @@ Flags:
-s, --skin string Color scheme/skin to use (default, or name of a skin file)
--stop-words strings Additional stop words to filter out from analysis (adds to built-in list)

Web Dashboard Flags:
--web-port int Port for the Dstl8 Lite web dashboard (default: 5718)
--web-disabled Disable the web dashboard

Kubernetes Flags:
--k8s-enabled=true Enable Kubernetes log streaming mode
--k8s-namespaces stringArray Kubernetes namespace(s) to watch (can specify multiple, default: all)
Expand Down Expand Up @@ -501,6 +540,10 @@ test-mode: false
# AI configuration
ai-provider: "openai" # Options: "openai" (default), "claude-code"
ai-model: "gpt-4"

# Web dashboard (Dstl8 Lite)
web-port: 5718 # Port for the web dashboard
web-disabled: false # Set to true to disable
```

See [examples/config.yml](examples/config.yml) for a complete configuration example with detailed comments.
Expand Down Expand Up @@ -689,6 +732,8 @@ When you don't specify the `--ai-model` flag, Gonzo automatically selects the be
| `GONZO_LOG_BUFFER` | Override log buffer size |
| `GONZO_MEMORY_SIZE` | Override memory size |
| `GONZO_AI_MODEL` | Override default AI model |
| `GONZO_WEB_PORT` | Override web dashboard port (default: 5718) |
| `GONZO_WEB_DISABLED` | Disable web dashboard (true/false) |
| `GONZO_TEST_MODE` | Enable test mode |
| `NO_COLOR` | Disable colored output |

Expand Down Expand Up @@ -760,16 +805,19 @@ Gonzo is built with:
- **OpenTelemetry** - Native OTLP support
- **Large amounts of** ☕️

The architecture follows a clean separation:
The architecture follows a clean separation with a shared analysis engine:

```
cmd/gonzo/ # Main application entry
internal/
├── tui/ # Terminal UI implementation
├── analyzer/ # Log analysis engine
├── engine/ # Shared analysis engine (feeds TUI and web)
├── tui/ # Terminal UI implementation
├── web/ # Dstl8 Lite web dashboard (embedded React)
├── analyzer/ # Log analysis engine
├── memory/ # Frequency tracking
├── otlplog/ # OTLP format handling
└── ai/ # AI integration
web/ # React frontend source (Vite + TypeScript)
```

## 🧪 Development
Expand All @@ -782,9 +830,13 @@ internal/
### Building

```bash
# Quick build
# Quick build (includes web dashboard)
make build

# Build web dashboard only
make web-deps # Install npm dependencies
make web-build # Build React app

# Run tests
make test

Expand Down Expand Up @@ -879,6 +931,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
- [AWS CloudWatch Logs Usage Guide](guides/CLOUDWATCH_USAGE_GUIDE.md) - Usage instructions for AWS CLI log tail and live tail with Gonzo
- [Stern Usage Guide](guides/STERN_USAGE_GUIDE.md) - Usage and examples for using Stern with Gonzo
- [Victoria Logs Integration](guides/VICTORIA_LOGS_USAGE.md) - Using Gonzo with Victoria Logs API
- [Web Dashboard](guides/WEB_DASHBOARD_USAGE.md) - Dstl8 Lite web UI setup
- [Contributing Guide](CONTRIBUTING.md) - How to contribute
- [Changelog](CHANGELOG.md) - Version history

Expand Down
44 changes: 43 additions & 1 deletion USAGE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,12 @@ cat test.log | ./build/gonzo
--reverse-scroll-wheel # Reverse scroll wheel direction (natural scrolling)
--config string # Config file (default: ~/.gonzo.yaml)

# Web dashboard (Dstl8 Lite)
--web-port=5718 # Port for the web dashboard
--web-disabled # Disable the web dashboard

# Version and help
-v, --version # Show version information
-v, --version # Show version information
-h, --help # Show help message

# Commands
Expand Down Expand Up @@ -273,6 +277,44 @@ This affects all scrollable areas:
- **Consistency**: Keep same scroll direction across all applications
- **Personal preference**: Use whichever feels more intuitive to you

## Web Dashboard (Dstl8 Lite)

Gonzo includes an embedded web dashboard that starts automatically alongside the TUI.

### Accessing the Dashboard

```bash
# Start Gonzo — web dashboard is available at http://localhost:5718
./build/gonzo -f test.log --follow

# Custom port
./build/gonzo -f test.log --web-port=3000

# Disable the web dashboard
./build/gonzo -f test.log --web-disabled
```

Open `http://localhost:5718` in your browser to see:
- **Workspaces** - Overview of active log streams with live sparklines
- **Stream Details** - Severity distribution, top attributes, pattern analysis, and live log viewer
- **Sentiment Heatmap** - Real-time heatmap grouped by pod, namespace, service, host, or deployment
- **Sources** - Browse log sources and their dimensions

The dashboard updates in real-time via WebSocket — the same data that powers the TUI.

### Building the Web Dashboard

The web dashboard is built with Vite + React + TypeScript and embedded into the Go binary.

```bash
# Install dependencies and build (included in make build)
make web-deps
make web-build

# Full build including web dashboard
make build
```

### Supported Integrations

- [Victoria Logs Integration](guides/VICTORIA_LOGS_USAGE.md) - Using Gonzo with Victoria Logs API
Expand Down
Loading
Loading