@@ -8,29 +8,18 @@ Both the Go and Rust implementations of proplet include monitoring capabilities
88
99## Architecture
1010
11- ```
12- ┌──────────────────────────────────────────────────────────────┐
13- │ Manager │
14- │ ┌────────────────────────────────────────────────────────┐ │
15- │ │ Aggregates metrics from all proplets │ │
16- │ │ Stores historical data │ │
17- │ │ Provides API for metrics queries │ │
18- │ └────────────────────────────────────────────────────────┘ │
19- └───────────────────────────┬──────────────────────────────────┘
20- │ MQTT
21- │ m/{domain}/c/{channel}/metrics/*
22- │
23- ┌───────────────────┼───────────────────┐
24- │ │ │
25- ▼ ▼ ▼
26- ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
27- │ Proplet │ │ Proplet │ │ Proplet │
28- │ (Go) │ │ (Rust) │ │ (Go) │
29- │ │ │ │ │ │
30- │ Monitors: │ │ Monitors: │ │ Monitors: │
31- │ - Task 1 │ │ - Task 3 │ │ - Task 5 │
32- │ - Task 2 │ │ - Task 4 │ │ │
33- └──────────────┘ └──────────────┘ └──────────────┘
11+ ``` mermaid
12+ graph TD
13+ Manager["<b>Manager</b><br/><br/>• Aggregates metrics from all proplets<br/>• Stores historical data<br/>• Provides API for metrics queries"]
14+
15+ Manager -->|"MQTT<br/>m/{domain}/c/{channel}/metrics/*"| Proplet1
16+ Manager -->|"MQTT<br/>m/{domain}/c/{channel}/metrics/*"| Proplet2
17+ Manager -->|"MQTT<br/>m/{domain}/c/{channel}/metrics/*"| Proplet3
18+
19+ Proplet1["<b>Proplet</b><br/>(Go)<br/><br/>Monitors:<br/>• Task 1<br/>• Task 2"]
20+ Proplet2["<b>Proplet</b><br/>(Rust)<br/><br/>Monitors:<br/>• Task 3<br/>• Task 4"]
21+ Proplet3["<b>Proplet</b><br/>(Go)<br/><br/>Monitors:<br/>• Task 5"]
22+
3423```
3524
3625## Features
@@ -405,13 +394,13 @@ Metrics are published to MQTT topics for real-time monitoring and integration wi
405394
406395** Go Proplet:**
407396
408- ```
397+ ``` txt
409398m/{domain_id}/c/{channel_id}/control/proplet/task_metrics
410399```
411400
412401** Rust Proplet:**
413402
414- ```
403+ ``` txt
415404m/{domain_id}/c/{channel_id}/metrics/proplet
416405```
417406
@@ -594,26 +583,26 @@ Memory overhead scales with history size:
594583
5955841. Check if monitoring is enabled globally:
596585
597- ` ` ` bash
598- echo $PROPLET_ENABLE_MONITORING
599- ```
586+ ` ` ` bash
587+ echo $PROPLET_ENABLE_MONITORING
588+ ```
600589
6015902 . Verify MQTT connection:
602591
603- ``` bash
604- mosquitto_sub -h localhost -t " m/+/c/+/metrics/#" -v
605- ```
592+ ``` bash
593+ mosquitto_sub -h localhost -t " m/+/c/+/metrics/#" -v
594+ ```
606595
6075963 . Check task monitoring profile in task request:
608597
609- ``` json
610- {
611- "monitoringProfile" : {
612- "enabled" : true ,
613- "export_to_mqtt" : true
614- }
615- }
616- ```
598+ ``` json
599+ {
600+ "monitoringProfile" : {
601+ "enabled" : true ,
602+ "export_to_mqtt" : true
603+ }
604+ }
605+ ```
617606
6186074 . Check proplet logs for monitoring errors
619608
@@ -644,9 +633,9 @@ Some metrics have limited support on Windows. Consider:
644633
6456341 . Verify MQTT broker is running:
646635
647- ``` bash
648- docker ps | grep mosquitto
649- ```
636+ ``` bash
637+ docker ps | grep mosquitto
638+ ```
650639
6516402 . Check proplet MQTT configuration
6526413 . Ensure ` export_to_mqtt: true ` in monitoring profile
@@ -733,51 +722,51 @@ CPU usage is measured as a percentage over the collection interval. For accurate
733722
7347231 . Start the Propeller infrastructure:
735724
736- ``` bash
737- docker compose up -d
738- ```
725+ ``` bash
726+ docker compose up -d
727+ ```
739728
7407292 . Start proplet with monitoring enabled:
741730
742- ** Go Proplet:**
731+ ** Go Proplet:**
743732
744- ``` bash
745- export PROPLET_ENABLE_MONITORING=true
746- export PROPLET_METRICS_INTERVAL=10
747- ./build/proplet
748- ```
733+ ``` bash
734+ export PROPLET_ENABLE_MONITORING=true
735+ export PROPLET_METRICS_INTERVAL=10
736+ ./build/proplet
737+ ```
749738
750- ** Rust Proplet:**
739+ ** Rust Proplet:**
751740
752- ``` bash
753- export PROPLET_ENABLE_MONITORING=true
754- export PROPLET_METRICS_INTERVAL=5
755- export PROPLET_DOMAIN_ID=domain-123
756- export PROPLET_CHANNEL_ID=channel-456
757- export PROPLET_CLIENT_ID=proplet-rs-001
758- export PROPLET_CLIENT_KEY=secret
759- cargo run --release
760- ```
741+ ``` bash
742+ export PROPLET_ENABLE_MONITORING=true
743+ export PROPLET_METRICS_INTERVAL=5
744+ export PROPLET_DOMAIN_ID=domain-123
745+ export PROPLET_CHANNEL_ID=channel-456
746+ export PROPLET_CLIENT_ID=proplet-rs-001
747+ export PROPLET_CLIENT_KEY=secret
748+ cargo run --release
749+ ```
761750
7627513 . Subscribe to metrics:
763752
764- ``` bash
765- mosquitto_sub -h localhost -t " m/+/c/+/metrics/#" -v
766- ```
753+ ``` bash
754+ mosquitto_sub -h localhost -t " m/+/c/+/metrics/#" -v
755+ ```
767756
7687574 . Submit a task with monitoring:
769758
770- ``` json
771- {
772- "id" : " test-task" ,
773- "functionName" : " compute" ,
774- "imageURL" : " registry.example.com/compute:v1" ,
775- "monitoringProfile" : {
776- "enabled" : true ,
777- "interval" : 5 ,
778- "export_to_mqtt" : true
779- }
780- }
781- ```
759+ ``` json
760+ {
761+ "id" : " test-task" ,
762+ "functionName" : " compute" ,
763+ "imageURL" : " registry.example.com/compute:v1" ,
764+ "monitoringProfile" : {
765+ "enabled" : true ,
766+ "interval" : 5 ,
767+ "export_to_mqtt" : true
768+ }
769+ }
770+ ```
782771
7837725 . Observe metrics in real-time
0 commit comments