Conversation
Adds the raw data behind the requested MTI coverage, unknown-asset, per-asset staleness and TAK-output KPIs, kept definition-free so the thresholds can be decided in the dashboard: - TwinStatusJMX (name=Twins, per twin type and lifecycle): twin counts broken down by MTI state and cumulative MTI-age buckets. Reads the MTI cache through a new side-effect-free MtiStatusRegistry snapshot, so scrapes don't skew the existing lookup hit/miss counters. - TakOutputJMX (name=TakOutput): TAK socket connects, connect failures, disconnects, open connections, last write age, socket and publisher drop counts, and a receipt-to-CoT latency histogram. TakSocketConnection previously swallowed every connection failure without any trace. - MAVLink last message age, for feed-gap detection. NO-ISSUE Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds report-age buckets and joint "reported and MTI-known" counts to TwinStatusJMX, and a PictureRecoveryTracker that times each asset's restoration from valid data back at MAPS to a fresh classified CoT handed to TAK, by failure type (feed loss, restart, MTI status loss) and stage. NO-ISSUE Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 tasks done
This branch has not been deployed
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
Adds JMX metrics so operational KPIs (MTI coverage, unknown/stale assets, TAK output health, recovery time) can be computed in Prometheus/Grafana. Everything is additive: no behaviour changes, only counters and observers.
TwinStatusJMX(type=Integration,name=Twins,twinType=..,lifecycle=.., managed byTwinMetricsManager): twin counts per type × lifecycle, MTI state counts (none/go/mitigate/hold/unknown/other), cumulative MTI-age buckets, report-age buckets (10/30/60/120 s) and a joint "reported recently and MTI-known" count. The joint count is needed because "stale or unknown" can't be derived from separate stale and unknown counts without double-counting.MtiStatusRegistry.snapshot(): a side-effect-free read of an asset's MTI status for the metrics above, plus aStatusListenerhook thatMtiStatusAdapterfires on status changes.TakOutputJMX/TakOutputStats(name=TakOutput): TAK socket connects, connect failures, disconnects, connected state, last-write age, socket and publisher drop counts, and a receipt-to-CoT latency histogram.TakSocketConnectionstill doesn't log its failures, but they are now counted.PictureRecoveryTracker/PictureRecoveryJMX(name=PictureRecovery,failureType=..,stage=..): per-asset restoration delay, from valid data arriving back at MAPS to a fresh, classified CoT handed to TAK. Recovery events are opened on feed loss, restart or MTI status loss, and closed in two stages:PICTURE(position back in TAK) andSTATUS(MTI status back). Each stage records count, sum, last value and a cumulative histogram, plus a not-restored count for events that time out or are superseded. Hooked intoTakTwinObserverand the MTI status listener.MavlinkIntegrationJMX, for detecting feed gaps.Metric definitions (what counts as active, covered or stale) are left to the dashboard on purpose, so they can change without code changes.
Test plan
TwinStatusJMXTest,TakOutputStatsTest,PictureRecoveryTrackerTest: bucket boundaries, the joint fresh-and-known count, recovery open/close per failure type and stage, supersede/timeout handling, histogram cumulativityio.mapsmessaging.state.**tests pass on this branch (858 run, 0 failures)🤖 Generated with Claude Code