Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit d80ff27

Browse files
committed
docs: update reference.md
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
1 parent ee00470 commit d80ff27

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

docs/monitoring.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Propeller tracks OS-level metrics for every WebAssembly task running on proplets. The system collects CPU usage, memory consumption, disk I/O, thread counts, and more with minimal performance overhead.
66

7-
Both Go and Rust proplets include built-in monitoring using `gopsutil` for Go and `sysinfo` for Rust. These libraries provide cross-platform compatibility across Linux, macOS, and Windows environments.
7+
Propeller tracks OS-level metrics for every WebAssembly task running on proplets. The system collects CPU usage, memory consumption, disk I/O, thread counts, and more with minimal performance overhead. The Rust proplet includes built-in monitoring using the `sysinfo` crate for cross-platform metrics. This provides compatibility across Linux, macOS, and Windows environments.
88

99
## Architecture
1010

@@ -16,7 +16,9 @@ Each proplet monitors its running tasks independently and reports metrics to the
1616

1717
1. Proplet spawns a monitoring thread for each task
1818
2. Thread collects process metrics at configured intervals (1-120 seconds)
19-
3. Metrics are published to MQTT topic `m/{domain}/c/{channel}/metrics/proplet`
19+
3. Metrics are published to MQTT topics:
20+
- Proplet-level: `m/{domain}/c/{channel}/control/proplet/metrics`
21+
- Task-level: `m/{domain}/c/{channel}/control/proplet/task_metrics`
2022
4. Manager receives and stores metrics in memory
2123
5. API clients query metrics via HTTP endpoints
2224

docs/reference.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Process Monitoring Implementation
22

3-
This document describes the complete process monitoring implementation for both Go and Rust proplets in the Propeller distributed task execution system.
3+
This document describes the complete process monitoring implementation for Rust proplets in the Propeller distributed task execution system.
44

55
## Overview
66

@@ -12,17 +12,29 @@ Comprehensive OS-level process monitoring has been implemented for:
1212

1313
## Monitoring Profiles
1414

15-
Both implementations provide identical profiles:
15+
Profiles define which metrics to collect, how often, and how much history to retain.
1616

17-
| Profile | Interval | Metrics | Export | History | Use Case |
18-
| ------------------- | -------- | ---------------------------------- | ------ | ------- | ------------------- |
19-
| Standard | 10s | All | Yes | 100 | General purpose |
20-
| Minimal | 60s | CPU, Memory | No | 0 | Lightweight |
21-
| Intensive | 1s | All | Yes | 1000 | Debug/analysis |
22-
| Batch Processing | 30s | CPU, Memory, Disk | Yes | 200 | Data processing |
23-
| Real-time API | 5s | CPU, Memory, Network, Threads, FDs | Yes | 500 | HTTP/API servers |
24-
| Long-running Daemon | 120s | All | Yes | 500 | Background services |
25-
| Disabled | - | None | No | 0 | No monitoring |
17+
The Rust implementation provides two built-in profiles:
18+
19+
| Profile | Interval | Metrics | Export | History | Use Case |
20+
| ------------------- | -------- | ------- | ------ | ------- | ------------------- |
21+
| Standard | 10s | All | Yes | 100 | General purpose |
22+
| Long-running Daemon | 120s | All | Yes | 500 | Background services |
23+
24+
### Custom Profiles
25+
26+
You can also define custom monitoring profiles via JSON configuration with the following options:
27+
28+
- `enabled`: Enable/disable monitoring (default: `true`)
29+
- `interval`: Collection interval in seconds (default: `10`)
30+
- `collect_cpu`: Collect CPU metrics (default: `true`)
31+
- `collect_memory`: Collect memory metrics (default: `true`)
32+
- `collect_disk_io`: Collect disk I/O metrics (default: `true`)
33+
- `collect_threads`: Collect thread count (default: `true`)
34+
- `collect_file_descriptors`: Collect file descriptor count (default: `true`)
35+
- `export_to_mqtt`: Publish metrics to MQTT (default: `true`)
36+
- `retain_history`: Keep metrics history (default: `true`)
37+
- `history_size`: Maximum history entries (default: `100`)
2638

2739
## Metrics Collected
2840

@@ -44,11 +56,10 @@ Both implementations provide identical profiles:
4456

4557
## MQTT Topics
4658

47-
### Proplet-Level Metrics (Go)
59+
### Proplet-Level Metrics
4860

49-
```txt
61+
````txt
5062
m/{domain_id}/c/{channel_id}/control/proplet/metrics
51-
```
5263
5364
Publishes overall proplet health metrics.
5465
@@ -57,7 +68,7 @@ Publishes overall proplet health metrics.
5768
```txt
5869
m/{domain_id}/c/{channel_id}/control/proplet/task_metrics # Go
5970
m/{domain_id}/c/{channel_id}/metrics/proplet # Rust
60-
```
71+
````
6172

6273
Publishes per-task process metrics.
6374

@@ -96,18 +107,11 @@ Publishes per-task process metrics.
96107

97108
## Configuration
98109

99-
### Go Proplet Environment Variables
100-
101-
```bash
102-
PROPLET_METRICS_INTERVAL=10 # Interval in seconds
103-
PROPLET_ENABLE_MONITORING=true # Enable/disable
104-
```
105-
106110
### Rust Proplet Environment Variables
107111

108112
```bash
109-
PROPLET_ENABLE_MONITORING=true # Enable/disable
110-
PROPLET_METRICS_INTERVAL=10 # Interval in seconds
113+
export PROPLET_ENABLE_MONITORING=true # Enable/disable monitoring (default: true)
114+
export PROPLET_METRICS_INTERVAL=10 # Proplet-level metrics interval in seconds (default: 10)
111115
```
112116

113117
### Per-Task Configuration (JSON)
@@ -142,8 +146,6 @@ Measured overhead across platforms:
142146

143147
## Usage Examples
144148

145-
### Go - Start Task with Monitoring
146-
147149
```go
148150
task := task.Task{
149151
ID: "task-123",
@@ -233,21 +235,18 @@ mosquitto_sub -h localhost -t "m/+/c/+/*/metrics" -v
233235
## Future Enhancements
234236

235237
1. Manager Integration
236-
237238
- Aggregate metrics from all proplets
238239
- Historical metrics storage
239240
- Metrics API endpoints
240241
- Alerting on anomalies
241242

242243
2. Advanced Metrics
243-
244244
- GPU usage (if available)
245245
- Container-specific metrics (cgroups)
246246
- Custom application metrics
247247
- Distributed tracing correlation
248248

249249
3. Optimization
250-
251250
- Adaptive sampling rates
252251
- Metric compression
253252
- Batched MQTT publishing

0 commit comments

Comments
 (0)