From 33d3cf2dd2445a84631a5e03e81ff2275d45a78b Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Mon, 2 Mar 2026 21:21:29 +0100 Subject: [PATCH] feat(monitoring): add monitoring.proto with gRPC service definition Co-Authored-By: Claude Opus 4.6 --- .../monitoring_service/proto/monitoring.proto | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 services/monitoring_service/proto/monitoring.proto diff --git a/services/monitoring_service/proto/monitoring.proto b/services/monitoring_service/proto/monitoring.proto new file mode 100644 index 000000000..c3f90f4ab --- /dev/null +++ b/services/monitoring_service/proto/monitoring.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; +package monitoring; + +service MonitoringService { + // Single snapshot of all active training sessions + rpc GetLiveTrainingMetrics(GetLiveTrainingMetricsRequest) + returns (GetLiveTrainingMetricsResponse); + + // Server-streaming: pushes updates every N seconds + rpc StreamTrainingMetrics(StreamTrainingMetricsRequest) + returns (stream GetLiveTrainingMetricsResponse); +} + +message GetLiveTrainingMetricsRequest { + string model_filter = 1; // optional: "dqn", "ppo", etc. +} + +message StreamTrainingMetricsRequest { + string model_filter = 1; + uint32 interval_seconds = 2; // 0 = server default (3s) +} + +message GetLiveTrainingMetricsResponse { + repeated TrainingSession sessions = 1; + GpuSnapshot gpu = 2; + uint32 active_k8s_jobs = 3; + int64 timestamp = 4; +} + +message TrainingSession { + string model = 1; + string fold = 2; + bool is_hyperopt = 3; + + // Epoch/progress + float current_epoch = 4; + float epoch_loss = 5; + float validation_loss = 6; + + // Throughput + float batches_per_second = 7; + float batches_processed = 8; + float iteration_seconds = 9; + + // Eval metrics + float eval_accuracy = 10; + float eval_precision = 11; + float eval_recall = 12; + float eval_f1 = 13; + + // Checkpoint + float checkpoint_size_bytes = 14; + uint32 checkpoint_saves = 15; + uint32 checkpoint_failures = 16; + + // Health counters + uint32 nan_detected = 17; + uint32 gradient_explosions = 18; + uint32 feature_errors = 19; + + // Hyperopt fields (populated when is_hyperopt=true) + uint32 hyperopt_trial_current = 20; + uint32 hyperopt_trial_total = 21; + float hyperopt_best_objective = 22; + uint32 hyperopt_trials_failed = 23; +} + +message GpuSnapshot { + float utilization_percent = 1; + float memory_used_mb = 2; + float memory_total_mb = 3; + float temperature_celsius = 4; + float power_watts = 5; +}