feat(operators): wire metrics field and add collect_metrics() to OperatorManager#203
Open
bootcrowns wants to merge 2 commits intoopen-jarvis:mainfrom
Open
feat(operators): wire metrics field and add collect_metrics() to OperatorManager#203bootcrowns wants to merge 2 commits intoopen-jarvis:mainfrom
bootcrowns wants to merge 2 commits intoopen-jarvis:mainfrom
Conversation
…atorManager OperatorManifest has had a `metrics: List[str]` field since the initial commit but OperatorManager never read it. This change wires that field through the manager in three ways: 1. activate(): passes `metrics` into the scheduler task metadata so workers can introspect which metrics an operator cares about. 2. status(): includes `metrics` in the per-operator status dict returned to callers, making it visible alongside tools and schedule info. 3. collect_metrics(operator_id, *, since, until) [new method]: queries the system's TelemetryAggregator (system.telemetry) and returns only the summary fields explicitly declared in manifest.metrics. Unknown metric names are skipped with a DEBUG log so old manifests remain forward-compatible. Returns an empty dict gracefully when telemetry is not configured.
Collaborator
|
Hi @bootcrowns , Thank you for your contribution! Would you be able to repair the lint errors? Once fixed, I can merge the PR. Thank you so much! |
Author
|
Hi @robbym-dev, thanks for the review! I've wrapped the long lines in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OperatorManifesthas had ametrics: List[str]field since the initial commit butOperatorManagernever read it, leaving the monitoring infrastructure described in the roadmap (Workstream 1 – Metrics Collection) unimplemented.This PR wires the
metricsfield through the manager in three places:Changes
activate()— passesmanifest.metricsinto the scheduler task metadata so workers/plugins can introspect which metrics the operator declares.status()— includesmetricsin the per-operator status dict alongsidetools,schedule_type, etc., so callers get a complete view of the operator's declared monitoring intent.collect_metrics(operator_id, *, since, until)[new method] — queriessystem.telemetry(aTelemetryAggregatorinstance) and returns only the summary-level stat fields explicitly declared inmanifest.metrics. Behaviour:{}gracefully whenmanifest.metricsis empty or telemetry is not configured.DEBUGlog (forward-compatible with future stats).since/untilUnix-timestamp filters, passed through toTelemetryAggregator.summary().Supported metric names
Any field on
AggregatedStatsfromopenjarvis.telemetry.aggregator:total_calls,total_tokens,total_cost,total_latency,total_energy_joules,avg_throughput_tok_per_sec,avg_gpu_utilization_pct,avg_energy_per_output_token_joules,avg_throughput_per_watt,total_prefill_energy_joules,total_decode_energy_joules,avg_mean_itl_ms,avg_median_itl_ms,avg_p95_itl_ms.Example operator TOML
Testing
collect_metricsis safe to call whensystem.telemetryisNone(returns{}).Relates to Workstream 1 (Metrics Collection) in the development roadmap.