Skip to content

Commit 6f89129

Browse files
committed
fix: add goreleaser github actions; remove quick mode and other flags
1 parent 33b456b commit 6f89129

File tree

7 files changed

+105
-358
lines changed

7 files changed

+105
-358
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*' # Trigger on version tags like v2.0.0, v2.1.0, etc.
6+
- 'v*' # Trigger on version tags like v0.1.0, v0.2.0, etc.
77

88
permissions:
99
contents: write # Required to create releases and upload assets

CLAUDE.md

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
NodePulse Agent v2.0 is a lightweight Prometheus forwarder written in Go that scrapes metrics from `node_exporter` and forwards them to a central dashboard via HTTP. The agent is designed to be minimal (<15 MB binary, <40 MB RAM) and efficient, with smart buffering for offline resilience using a Write-Ahead Log (WAL) pattern.
7+
NodePulse Agent is a lightweight Prometheus forwarder written in Go that scrapes metrics from `node_exporter` and forwards them to a central dashboard via HTTP. The agent is designed to be minimal (<15 MB binary, <40 MB RAM) and efficient, with smart buffering for offline resilience using a Write-Ahead Log (WAL) pattern.
88

99
## Build & Development Commands
1010

@@ -58,13 +58,13 @@ The agent uses [Cobra](https://github.com/spf13/cobra) for CLI command handling:
5858
- Foreground mode (`pulse start`): Runs in terminal, blocks execution
5959
- Daemon mode (`pulse start -d`): Spawns background process using `exec.Command` with `Setsid: true`
6060
- Both modes create PID file EXCEPT when running under systemd (detected via `INVOCATION_ID` env var)
61-
- **v2.0**: Scrapes Prometheus instead of collecting custom metrics
61+
- **Current**: Scrapes Prometheus instead of collecting custom metrics
6262
- **cmd/stop.go**: Stops daemon mode only (reads PID file, sends SIGTERM → SIGKILL if needed)
6363
- Will NOT stop systemd-managed processes (they don't create PID files)
6464
- Provides helpful message if systemd service is running
6565
- **cmd/service.go**: systemd service management (install/start/stop/restart/status/uninstall)
6666
- **cmd/setup.go**: Setup wizard for first-time configuration (command: `pulse setup`)
67-
- **v2.0**: Interactive TUI mode removed, only quick mode (`--yes`) available
67+
- **Current**: Interactive TUI mode removed, only quick mode (`--yes`) available
6868
- Prompts for: endpoint URL and server_id
6969
- **cmd/status.go**: Shows comprehensive agent status including server ID, config, service status, buffer state, and logs
7070
- **cmd/update.go**: Self-update command that checks for new versions and performs updates
@@ -102,7 +102,7 @@ Write-Ahead Log (WAL) pattern with HTTP forwarding + file-based buffering:
102102
Uses [Viper](https://github.com/spf13/viper) for config loading from YAML:
103103

104104
- **config.go**: Main config loading, validation, and defaults
105-
- **v2.0**: Added `PrometheusConfig` section
105+
- **Current**: Added `PrometheusConfig` section
106106
- Default interval changed to 15s (Prometheus standard)
107107
- Allowed intervals: 15s, 30s, 1m (removed 5s, 10s)
108108
- Default endpoint: `/metrics/prometheus`
@@ -169,18 +169,6 @@ The agent runs as a **long-running daemon**:
169169

170170
**Key Design Point**: The agent scrapes Prometheus exporters and forwards the text format. It does NOT parse or interpret the metrics - it's a simple forwarder.
171171

172-
## Removed in v2.0
173-
174-
### TUI Dashboard (cmd/watch.go) - REMOVED
175-
- ❌ No longer exists
176-
- ❌ All Bubble Tea and Lipgloss dependencies removed
177-
- Users should use the dashboard for visualization
178-
179-
### Custom Metrics Collection (internal/metrics/) - REMOVED
180-
- ❌ No longer collects custom metrics
181-
- ❌ All custom collectors deleted (cpu.go, memory.go, network.go, disk.go, uptime.go, etc.)
182-
- ✅ Replaced with Prometheus scraping (100+ metrics from node_exporter)
183-
184172
## Important Platform Constraints
185173

186174
- **Linux-only**: Requires `node_exporter` running on `localhost:9100`
@@ -238,21 +226,3 @@ This project uses [GoReleaser](https://goreleaser.com/) for multi-architecture b
238226
- Config validation happens after loading, before agent starts
239227
- Server ID is validated to ensure alphanumeric start/end, can contain dashes in middle
240228
- All logging uses structured fields (zap)
241-
242-
## v2.0 Migration Notes
243-
244-
### Breaking Changes
245-
1. **Configuration**: New `prometheus` section required
246-
2. **Endpoint**: Changed from `/metrics` to `/metrics/prometheus`
247-
3. **Interval**: Default changed to 15s (was 5s), allowed: 15s, 30s, 1m
248-
4. **Buffer format**: `.prom` files instead of `.json`
249-
5. **TUI removed**: `pulse watch` command no longer exists
250-
6. **Dependencies**: Requires `node_exporter` to be installed
251-
252-
### New Dependencies
253-
- None (removed TUI dependencies: bubbletea, lipgloss, bubbles)
254-
255-
### File Changes
256-
- **Created**: `internal/prometheus/scraper.go`, `internal/prometheus/scraper_test.go`
257-
- **Modified**: All `internal/report/*.go`, `internal/config/config.go`, `cmd/start.go`, `cmd/setup.go`, `cmd/update.go`
258-
- **Deleted**: `cmd/watch.go`, `cmd/themes/`, `cmd/common.go`, `cmd/setup_tui.go`, all `internal/metrics/*.go`

README.md

Lines changed: 5 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NodePulse Agent v2.0
1+
# NodePulse Agent
22

33
A lightweight Prometheus forwarder written in Go. It scrapes metrics from `node_exporter` and forwards them to your NodePulse dashboard via HTTP.
44

@@ -8,24 +8,6 @@ A lightweight Prometheus forwarder written in Go. It scrapes metrics from `node_
88
- <40 MB RAM usage
99
- Standard 15-second scrape interval
1010

11-
## What's New in v2.0
12-
13-
**Major Architecture Change:**
14-
15-
-**Prometheus-based**: Scrapes `node_exporter` (100+ metrics)
16-
-**Simpler**: No custom metrics collection
17-
-**Standard**: Uses Prometheus text format
18-
-**Buffered**: Write-Ahead Log pattern for reliability
19-
-**No TUI**: `nodepulse watch` command removed
20-
-**No JSON**: Prometheus text format only
21-
22-
**Why Prometheus?**
23-
24-
- Industry standard for metrics collection
25-
- Rich ecosystem of exporters
26-
- 100+ system metrics out of the box
27-
- Battle-tested reliability
28-
2911
## Features
3012

3113
- **Prometheus Scraping**: Scrapes `node_exporter` on `localhost:9100`
@@ -119,13 +101,13 @@ sudo chmod +x /usr/local/bin/nodepulse
119101
### Initialize Configuration (First Time Setup)
120102

121103
```bash
122-
sudo nodepulse setup --yes --endpoint-url https://dashboard.nodepulse.io/metrics/prometheus --server-id <your-uuid>
104+
sudo nodepulse setup --endpoint-url https://dashboard.nodepulse.io/metrics/prometheus --server-id <your-uuid>
123105
```
124106

125-
Quick setup wizard that:
107+
Setup command:
126108

127-
- Creates necessary directories (`/etc/nodepulse`, `/var/lib/nodepulse`)
128-
- Creates configuration file with your settings
109+
- Creates necessary directories (`/etc/nodepulse`, `/var/lib/nodepulse`, `/var/log/nodepulse`)
110+
- Generates configuration file with hardcoded defaults
129111
- Uses provided server ID (assigned by dashboard when adding server)
130112

131113
**Server ID**: When you add a server in the dashboard, it will provide a UUID. Pass this as `--server-id`.
@@ -464,56 +446,6 @@ make build-linux-arm64
464446
- Storage estimate: ~3 TB for 1000 servers
465447
- Industry standard for self-hosted monitoring
466448

467-
## Migration from v1.x
468-
469-
### Breaking Changes
470-
471-
1. **Configuration file changes:**
472-
- New `prometheus` section required
473-
- `server.endpoint` changes from `/metrics` to `/metrics/prometheus`
474-
- Default interval changes from 5s to 15s
475-
- Allowed intervals: `15s`, `30s`, `1m` (removed 5s, 10s)
476-
477-
2. **Buffered data:**
478-
- Old JSON buffer files will be ignored (data loss <48 hours)
479-
- New buffer format stores Prometheus text format (`.prom` files)
480-
481-
3. **Commands removed:**
482-
- `nodepulse watch` no longer exists (TUI removed)
483-
484-
### Migration Steps
485-
486-
1. **Install node_exporter** (see Prerequisites above)
487-
2. **Stop old agent:**
488-
```bash
489-
sudo nodepulse service stop
490-
sudo nodepulse service uninstall
491-
```
492-
3. **Update agent binary:**
493-
```bash
494-
sudo nodepulse update
495-
# Or manually download v2.0
496-
```
497-
4. **Update config file:**
498-
```bash
499-
sudo nano /etc/nodepulse/nodepulse.yml
500-
# Add prometheus section, change interval to 15s
501-
```
502-
5. **Clear old buffer** (optional):
503-
```bash
504-
sudo rm -rf /var/lib/nodepulse/buffer/*
505-
```
506-
6. **Reinstall service:**
507-
```bash
508-
sudo nodepulse service install
509-
sudo nodepulse service start
510-
```
511-
7. **Verify:**
512-
```bash
513-
sudo nodepulse status
514-
sudo journalctl -u nodepulse -f
515-
```
516-
517449
## Development
518450

519451
### Project Structure

0 commit comments

Comments
 (0)