Repository navigation
fix: difference console counter rates per pod - #830
Merged
Merged
Conversation
The console summed each counter across the fleet per timestamp, then differenced the first and last totals. TimeUnix has one-second precision and pods export on their own clocks, so the totals rarely lined up and consecutive points subtracted one pod's counter from another's. Two pods each adding 100 over 60s, 7s apart, read 61.19/s instead of 3.33/s. The per-source signals had the same shape: two loader pods with flat counters read 3582 records a minute and a fresh arrival on every export. Each series is now differenced against its own previous reading and the per-series rates are summed. A series is one metric name, one attribute set and one pod (service.instance.id), the key latest_gauges uses. A reading below the one before it is a restart and counts from zero, so a restart no longer reads as negative throughput (counter_rates) or as no reading at all (source signals). source_landing_counter now returns one row per series - increase, span and the epoch second of its latest rise - and source_signals sums the rates and takes the latest rise across them. New integration tests write to the real otel_metrics_sum table. Old code against new: two pods 7s apart 61.19 vs 3.33/s, a mid-window restart -15.67 vs 1.67/s, a pod appearing mid-window 1.67 vs 3.67/s, two loader pods 3671.6 vs 200 records a minute, flat loader pods 3582 vs 0 with no arrival, a restarted loader pod null vs 100 a minute. A single pod and two attribute sets on one pod read the same on both.
|
Released in v1.22.29 -- https://github.com/hyperi-io/dfe-engine/releases/tag/v1.22.29 |
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.
The console summed each counter across the fleet per timestamp, then differenced the first and last totals. TimeUnix has one-second precision and pods export on their own clocks, so the totals rarely lined up and consecutive points subtracted one pod's counter from another's. Two pods each adding 100 over 60s, 7s apart, read 61.19/s instead of 3.33/s. The per-source signals had the same shape: two loader pods with flat counters read 3582 records a minute and a fresh arrival on every export.
Each series is now differenced against its own previous reading and the per-series rates are summed. A series is one metric name, one attribute set and one pod (service.instance.id), the key latest_gauges uses. A reading below the one before it is a restart and counts from zero, so a restart no longer reads as negative throughput (counter_rates) or as no reading at all (source signals).
source_landing_counter now returns one row per series - increase, span and the epoch second of its latest rise - and source_signals sums the rates and takes the latest rise across them.
New integration tests write to the real otel_metrics_sum table (tests/integration/test_counter_rates_ch.py). They run at the full tier, not in PR CI, so they were run locally against ClickHouse 26.3 with DFE_TEST_TIER=local. Old code against new:
Replicas that push without service.instance.id still share one series, and the alternation between their counters counts as traffic. The query comment says so.