Skip to content

Commit 43dd6c9

Browse files
committed
refactor: rename 'node-pulse' to 'nodepulse' across configuration, documentation, and codebase
1 parent e9b0b06 commit 43dd6c9

File tree

10 files changed

+77
-67
lines changed

10 files changed

+77
-67
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Binaries
2+
nodepulse
3+
/nodepulse-*
24
pulse
35
/pulse-*
46
/build/pulse-*
@@ -24,9 +26,11 @@ build/
2426

2527
# Buffer directory (for local testing)
2628
buffer/
29+
/var/lib/nodepulse/
2730
/var/lib/node-pulse/
2831

2932
# Config files (keep template only)
33+
/etc/nodepulse/
3034
/etc/node-pulse/
3135

3236
# IDE

cmd/service.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
)
1313

1414
const (
15-
serviceName = "node-pulse"
16-
serviceFile = "/etc/systemd/system/node-pulse.service"
17-
binaryPath = "/usr/local/bin/pulse"
15+
serviceName = "nodepulse"
16+
serviceFile = "/etc/systemd/system/nodepulse.service"
17+
binaryPath = "/opt/nodepulse/nodepulse"
1818
serviceTemplate = `[Unit]
1919
Description=NodePulse Server Monitor Agent
2020
After=network.target
@@ -100,7 +100,7 @@ func installService(cmd *cobra.Command, args []string) error {
100100
return fmt.Errorf("failed to get executable path: %w", err)
101101
}
102102

103-
// Copy binary to /usr/local/bin/pulse if not already there
103+
// Copy binary to installation directory if not already there
104104
if exePath != binaryPath {
105105
if err := copyFile(exePath, binaryPath); err != nil {
106106
return fmt.Errorf("failed to copy binary: %w", err)
@@ -130,7 +130,7 @@ func installService(cmd *cobra.Command, args []string) error {
130130

131131
fmt.Println("Service installed and enabled successfully!")
132132
fmt.Println("\nTo start the service, run:")
133-
fmt.Printf(" sudo pulse service start\n")
133+
fmt.Printf(" sudo nodepulse service start\n")
134134
return nil
135135
}
136136

cmd/start.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ func runInBackground() error {
178178
// Print warning
179179
fmt.Println("WARNING: Running in daemon mode (-d) is for development and debugging only.")
180180
fmt.Println("For production use, install as a systemd service:")
181-
fmt.Println(" pulse service install")
182-
fmt.Println(" pulse service start")
181+
fmt.Println(" nodepulse service install")
182+
fmt.Println(" nodepulse service start")
183183
fmt.Println()
184184

185185
// Build command arguments without the daemon flag

cmd/status.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ func runStatus(cmd *cobra.Command, args []string) error {
8383
// getServiceStatus checks if the systemd service is running
8484
func getServiceStatus() string {
8585
// Try to check systemd status
86-
cmd := exec.Command("systemctl", "is-active", "node-pulse")
86+
cmd := exec.Command("systemctl", "is-active", "nodepulse")
8787
output, err := cmd.Output()
8888

8989
if err == nil && string(output) == "active\n" {
9090
return "running (via systemd)"
9191
}
9292

9393
// Check if service exists but is not active
94-
cmd = exec.Command("systemctl", "is-enabled", "node-pulse")
94+
cmd = exec.Command("systemctl", "is-enabled", "nodepulse")
9595
_, err = cmd.Output()
9696

9797
if err == nil {
@@ -101,9 +101,9 @@ func getServiceStatus() string {
101101
return "not installed as systemd service"
102102
}
103103

104-
// countBufferFiles counts the number of .jsonl files in the buffer directory
104+
// countBufferFiles counts the number of .prom files in the buffer directory
105105
func countBufferFiles(bufferPath string) (int, error) {
106-
pattern := filepath.Join(bufferPath, "*.jsonl")
106+
pattern := filepath.Join(bufferPath, "*.prom")
107107
files, err := filepath.Glob(pattern)
108108
if err != nil {
109109
return 0, err

cmd/stop.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func stopAgent(cmd *cobra.Command, args []string) error {
3636
fmt.Println("No daemon agent is running.")
3737
fmt.Println("However, the systemd service appears to be active.")
3838
fmt.Println("To stop the systemd service, use:")
39-
fmt.Println(" sudo pulse service stop")
39+
fmt.Println(" sudo nodepulse service stop")
4040
return nil
4141
}
4242
fmt.Println("No agent is running")
@@ -87,8 +87,8 @@ func stopAgent(cmd *cobra.Command, args []string) error {
8787
return nil
8888
}
8989

90-
// isSystemdServiceActive checks if the node-pulse systemd service is active
90+
// isSystemdServiceActive checks if the nodepulse systemd service is active
9191
func isSystemdServiceActive() bool {
92-
cmd := exec.Command("systemctl", "is-active", "--quiet", "node-pulse")
92+
cmd := exec.Command("systemctl", "is-active", "--quiet", "nodepulse")
9393
return cmd.Run() == nil
9494
}

docs/buffer-mechanism.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ YYYYMMDD-HHMMSS-<server_id>.prom
142142

143143
**Examples:**
144144
```
145-
/var/lib/node-pulse/buffer/20251027-140000-550e8400-e29b-41d4-a716-446655440000.prom
146-
/var/lib/node-pulse/buffer/20251027-140015-550e8400-e29b-41d4-a716-446655440000.prom
147-
/var/lib/node-pulse/buffer/20251027-140030-550e8400-e29b-41d4-a716-446655440000.prom
145+
/var/lib/nodepulse/buffer/20251027-140000-550e8400-e29b-41d4-a716-446655440000.prom
146+
/var/lib/nodepulse/buffer/20251027-140015-550e8400-e29b-41d4-a716-446655440000.prom
147+
/var/lib/nodepulse/buffer/20251027-140030-550e8400-e29b-41d4-a716-446655440000.prom
148148
```
149149

150150
**Content:**
@@ -165,13 +165,13 @@ node_memory_MemTotal_bytes 8.589934592e+09
165165

166166
```yaml
167167
buffer:
168-
path: "/var/lib/node-pulse/buffer"
168+
path: "/var/lib/nodepulse/buffer"
169169
retention_hours: 48
170170
batch_size: 5
171171
```
172172
173173
**Settings:**
174-
- `path`: Buffer directory location (default: `/var/lib/node-pulse/buffer`)
174+
- `path`: Buffer directory location (default: `/var/lib/nodepulse/buffer`)
175175
- `retention_hours`: Auto-delete files older than this (default: 48 hours)
176176
- `batch_size`: Maximum files to process per batch (default: 5)
177177

@@ -278,17 +278,17 @@ Node Pulse Agent Status
278278
=====================
279279
280280
Server ID: 550e8400-e29b-41d4-a716-446655440000
281-
Config File: /etc/node-pulse/nodepulse.yml
281+
Config File: /etc/nodepulse/nodepulse.yml
282282
Endpoint: https://dashboard.nodepulse.io/metrics/prometheus
283283
Interval: 15s
284284
285285
Agent: running (via systemd)
286286
287-
Buffer: 12 report(s) pending in /var/lib/node-pulse/buffer
287+
Buffer: 12 report(s) pending in /var/lib/nodepulse/buffer
288288
Oldest: 2025-10-27 14:00:00
289289
Total size: 156 KB
290290
291-
Log File: /var/log/node-pulse/agent.log
291+
Log File: /var/log/nodepulse/agent.log
292292
```
293293

294294
**Buffer metrics:**
@@ -328,7 +328,7 @@ Log File: /var/log/node-pulse/agent.log
328328
**Default settings (recommended for most deployments):**
329329
```yaml
330330
buffer:
331-
path: "/var/lib/node-pulse/buffer"
331+
path: "/var/lib/nodepulse/buffer"
332332
retention_hours: 48
333333
batch_size: 5
334334
```

docs/project-overview.md

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
## Project Information
44

55
- **Repository**: `github.com/node-pulse/agent`
6-
- **CLI Command**: `pulse`
6+
- **CLI Command**: `nodepulse`
77
- **Language**: Go
88
- **Framework**: Cobra (CLI)
99
- **Target**: Linux servers (arm64 + amd64)
10+
- **Deployment**: Ansible-based (centrally managed from dashboard)
1011

1112
## Purpose
1213

@@ -24,8 +25,7 @@ agent/
2425
│ ├── stop.go # Stop command (stops daemon mode only)
2526
│ ├── setup.go # Setup wizard (quick mode only)
2627
│ ├── status.go # Status command (shows server ID, config, service, buffer)
27-
│ ├── service.go # Service management (systemd)
28-
│ └── update.go # Self-updater
28+
│ └── service.go # Service management (systemd)
2929
├── internal/
3030
│ ├── prometheus/ # Prometheus scraper
3131
│ │ ├── scraper.go # HTTP scraper for node_exporter
@@ -39,8 +39,7 @@ agent/
3939
│ │ └── serverid.go # Server ID persistence
4040
│ ├── logger/ # Structured logging (zap)
4141
│ ├── pidfile/ # PID file management
42-
│ ├── installer/ # Setup installer logic
43-
│ └── updater/ # Self-update system
42+
│ └── installer/ # Setup installer logic
4443
├── docs/ # Documentation
4544
├── .goreleaser.yaml # Cross-compilation config
4645
├── nodepulse.yml # Example config file
@@ -86,27 +85,27 @@ Each agent instance requires a unique `server_id` to identify which server is re
8685

8786
**Source:**
8887
- Assigned by dashboard when adding server
89-
- Passed to agent via Ansible deployment or `pulse setup --yes`
88+
- Passed to agent via Ansible deployment or `nodepulse setup --yes`
9089

9190
**Persistence locations** (tried in order):
9291

93-
- `/var/lib/node-pulse/server_id` ✅ (survives re-setup, not OS reinstall)
94-
- `/etc/node-pulse/server_id`
95-
- `~/.node-pulse/server_id`
92+
- `/var/lib/nodepulse/server_id` ✅ (survives re-setup, not OS reinstall)
93+
- `/etc/nodepulse/server_id`
94+
- `~/.nodepulse/server_id`
9695
- `./server_id` (fallback)
9796

9897
**Stability:**
9998

100-
- UUID persists across agent updates
99+
- UUID persists across agent updates (Ansible manages updates)
101100
- UUID is regenerated only after OS reinstall (when persistent file is wiped)
102-
- Check current UUID: `pulse status`
101+
- Check current UUID: `nodepulse status`
103102

104103
### Buffer Strategy (Write-Ahead Log Pattern)
105104

106105
**Always save to buffer first, then drain in background:**
107106

108107
```
109-
/var/lib/node-pulse/buffer/
108+
/var/lib/nodepulse/buffer/
110109
├── 20251027-140000-550e8400-e29b-41d4-a716-446655440000.prom
111110
├── 20251027-140015-550e8400-e29b-41d4-a716-446655440000.prom
112111
└── 20251027-140030-550e8400-e29b-41d4-a716-446655440000.prom
@@ -125,7 +124,7 @@ Each agent instance requires a unique `server_id` to identify which server is re
125124

126125
## Configuration File
127126

128-
**Location**: `/etc/node-pulse/nodepulse.yml`
127+
**Location**: `/etc/nodepulse/nodepulse.yml`
129128

130129
```yaml
131130
server:
@@ -142,15 +141,15 @@ prometheus:
142141
timeout: 3s
143142

144143
buffer:
145-
path: "/var/lib/node-pulse/buffer"
144+
path: "/var/lib/nodepulse/buffer"
146145
retention_hours: 48
147146
batch_size: 5
148147

149148
logging:
150149
level: "info"
151150
output: "stdout"
152151
file:
153-
path: "/var/log/node-pulse/agent.log"
152+
path: "/var/log/nodepulse/agent.log"
154153
max_size_mb: 10
155154
max_backups: 3
156155
max_age_days: 7
@@ -170,45 +169,45 @@ All other settings use hardcoded defaults.
170169
### Core Commands
171170

172171
```bash
173-
pulse setup --yes # Quick setup (prompts for endpoint and server_id)
174-
pulse start # Run agent in foreground (for testing/development)
175-
pulse start -d # Run agent in background daemon mode (development only)
176-
pulse stop # Stop daemon mode agent (does not affect systemd service)
177-
pulse status # Display comprehensive status
172+
nodepulse setup --yes # Quick setup (prompts for endpoint and server_id)
173+
nodepulse start # Run agent in foreground (for testing/development)
174+
nodepulse start -d # Run agent in background daemon mode (development only)
175+
nodepulse stop # Stop daemon mode agent (does not affect systemd service)
176+
nodepulse status # Display comprehensive status
178177
```
179178

180179
### Running Modes
181180

182-
**1. Foreground Mode** (`pulse start`)
181+
**1. Foreground Mode** (`nodepulse start`)
183182
- Blocks terminal, runs in foreground
184183
- Creates PID file to prevent duplicate runs
185184
- Stop with: Ctrl+C (graceful shutdown with cleanup)
186185
- Best for: Development and testing
187186

188-
**2. Daemon Mode** (`pulse start -d`)
187+
**2. Daemon Mode** (`nodepulse start -d`)
189188
- Runs in background, detached from terminal
190189
- Creates PID file for process management
191-
- Stop with: `pulse stop` command
190+
- Stop with: `nodepulse stop` command
192191
- Sends SIGTERM (5s grace period) then SIGKILL if needed
193192
- Best for: Quick testing, not production
194193

195-
**3. Systemd Service** (`pulse service start`)
194+
**3. Systemd Service** (`nodepulse service start`)
196195
- Managed by systemd (no PID file)
197196
- Auto-restart on failure, boot on startup
198-
- Stop with: `pulse service stop`
199-
- Best for: Production deployments
197+
- Stop with: `nodepulse service stop`
198+
- Best for: Production deployments (managed by Ansible)
200199

201-
**Important**: `pulse stop` only works for daemon mode. If systemd service is running, it provides helpful guidance to use `pulse service stop` instead.
200+
**Important**: `nodepulse stop` only works for daemon mode. If systemd service is running, it provides helpful guidance to use `nodepulse service stop` instead.
202201

203202
### Service Management
204203

205204
```bash
206-
pulse service install # Install systemd service
207-
pulse service start # Start the service
208-
pulse service stop # Stop the service
209-
pulse service restart # Restart the service
210-
pulse service status # Check detailed systemd service status
211-
pulse service uninstall # Remove the service
205+
nodepulse service install # Install systemd service
206+
nodepulse service start # Start the service
207+
nodepulse service stop # Stop the service
208+
nodepulse service restart # Restart the service
209+
nodepulse service status # Check detailed systemd service status
210+
nodepulse service uninstall # Remove the service
212211
```
213212

214213
## Build & Release
@@ -277,5 +276,13 @@ node_memory_MemTotal_bytes 8.589934592e+09
277276
- ✅ Background drain loop with jitter
278277
- ✅ Batch processing
279278
- ✅ Service management
280-
- Self-update system
279+
- Ansible-based deployment and updates
281280
- ✅ Documentation complete
281+
282+
### Update Management
283+
284+
Agent updates are **centrally managed via Ansible** from the dashboard:
285+
- No self-update mechanism in agent
286+
- Version control with rollback capability
287+
- Staged rollouts across server fleet
288+
- Deployment tracking per server

docs/pulse-logging-prd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ logging:
6565
level: "info" # debug, info, warn, error
6666
output: "both" # stdout, file, both
6767
file:
68-
path: "/var/log/node-pulse/agent.log"
68+
path: "/var/log/nodepulse/agent.log"
6969
max_size_mb: 10
7070
max_backups: 3
7171
max_age_days: 7
@@ -286,7 +286,7 @@ logging:
286286
level: "info"
287287
output: "both"
288288
file:
289-
path: "/var/log/node-pulse/agent.log"
289+
path: "/var/log/nodepulse/agent.log"
290290
max_size_mb: 10
291291
max_backups: 5
292292
max_age_days: 7

internal/report/sender.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (s *Sender) sendPrometheusHTTP(data []byte, serverID string) error {
9191
}
9292

9393
req.Header.Set("Content-Type", "text/plain; version=0.0.4")
94-
req.Header.Set("User-Agent", "node-pulse-agent/2.0")
94+
req.Header.Set("User-Agent", "nodepulse-agent/2.0")
9595

9696
resp, err := s.client.Do(req)
9797
if err != nil {

0 commit comments

Comments
 (0)