Repository navigation
feat(telemetry): add ingress traffic telemetry and latency anomaly diagnostic - #16
Merged
Merged
Conversation
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.
1. Architecture & Diagnostic Overview
This pull request introduces
TrafficTelemetryandAnomalyEventinscripts/traffic_telemetry.pyalongsidepytest.initest path configuration. It establishes an in-flight statistical latency profiling rotary and anomaly diagnostic engine for RouteKernel ingress proxies:2. Statistical Anomaly Detection Mechanics
Maintains a bounded circular buffer (default
To prevent division-by-zero or micro-jitter false alarms on ultra-consistent synthetic traffic, effective standard deviation is guarded by a dynamic floor:
WARNING.CRITICAL.Maintains smoothed latency trends $\text{EWMA}t = \alpha \cdot L_t + (1 - \alpha) \cdot \text{EWMA}{t-1}$ with smoothing parameter
3. Prometheus Metric Exposition Schema
routekernel_requests_total{service="..."}: Total request throughput counter.routekernel_upstream_errors_total{service="...",upstream="..."}: Upstream 5xx error counter per target.routekernel_latency_ms{service="...",quantile="0.50|0.90|0.99"}: Latency percentile gauges.routekernel_anomalies_total{service="..."}: Cumulative anomaly count.routekernel_http_status_total{service="...",status="<code>"}: Status code breakdown.4. Verification & Diagnostic Test Coverage
Full unit test suite in
tests/test_traffic_telemetry.py:test_traffic_telemetry_recording_and_percentiles: Asserts exacttest_traffic_telemetry_anomaly_detection_spike: Verifiestest_traffic_telemetry_error_tracking: Validates 5xx and connection drop tracking per upstream target.test_traffic_telemetry_prometheus_export: Validates metric syntax against standard Prometheus exposition guidelines.