Repository navigation
Fix processor metrics being reported under a sibling processor's name - #201
Merged
Merged
Conversation
CodeDrivenMitch
requested review from
a team,
Andrew-deVillier and
stefanmirkovic
and removed request for
a team
November 10, 2026 15:40
stefanmirkovic
approved these changes
Nov 10, 2026
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.
A customer reported a processor that was 50+ days behind, while all of its segments were at the head of the event store. Its Handler Insights also showed old events being handled by that processor. The events were fine. They belonged to a new processor in the same application that was replaying its history, and the client reported its measurements under the wrong processor name.
The cause is in
AxoniqPlatformConfigurerEnhancer. It walks the processor modules withdoOnSubModulesand registers anAxoniqPlatformEventHandlingComponentdecorator for each of them. However,doOnSubModuleshands the block the parent registry, not the module's own registry. So with four processors, the parent gets fourEventHandlingComponentdecorators, each bound to a different processor name. AF5 copies the decorators of a parent into every module (DefaultComponentRegistry.copyWithDecoratorsAndEnhancers), so every processor's components get wrapped once per processor. Only the outermost wrapper records the measurement, so the ingest latency, commit latency and handler statistics of all processors end up under one name, keyed by each processor's own segment ids. That explains the "50 days behind" on a processor at the head: another processor's replay of 50-day-old events was written to its segment ids.This PR registers the decorator on the processor module's own registry instead, through
BaseModule.componentRegistry(...). Each processor now wraps only its own components, with its own name.I added
ProcessorMetricsAttributionIntegrationTest. It boots a real AF5 configuration with two pooled streaming processors and the enhancer loaded as in an application. Each processor handles an event of a different age, and the test checks that each one reports only its own latency and handler statistics. Before the fix,beta-processorreported 0 latency andBetaEventwas counted underalpha-processor.