NIFI-16072 Add ProcessSessionEvent handling to ComponentMetricReporter#11398
Merged
Conversation
- Renamed FlowFileEvent to ProcessSessionEvent - Moved ProcessSessionEvent to framework-api for ComponentMetricReporter - Added recordProcessSessionEvent method to RepositoryContext
pvillard31
requested changes
Jul 6, 2026
| connectionEvent.setContentSizeOut(connectionEvent.getContentSizeOut() + bytes); | ||
| connectionEvent.setFlowFilesOut(connectionEvent.getFlowFilesOut() + flowFileCount); | ||
| final ProcessSessionEventBuilder connectionEvent = connectionCounts.computeIfAbsent( | ||
| connectionId, id -> ProcessSessionEventBuilder.forComponent(getConnectionMetricContext(connectionId))); |
Contributor
There was a problem hiding this comment.
In the id-only incrementConnectionOutputCounts used by migrate(), is the fallback context (name equal to id, no group attributes) intended for the destination session that never cached the connection?
Contributor
Author
There was a problem hiding this comment.
Yes, since the previous behavior did not include the name or attributes, the Connection MetricContext with reused id appears to be the best option, unless there is another clear way to get the needed Connection object for the new owner.
Contributor
Author
|
Thanks for the review @pvillard31, I pushed an update with some additional tests to verify the invocation of |
pvillard31
approved these changes
Jul 7, 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.
Summary
NIFI-16072 Continues incremental framework adjustments initiated under NIP-19 to support recording gauge values. The current set of changes adds a
recordProcessSessionEvent()method to theComponentMetricReporterinterface defined innifi-framework-api. This additional method aligns metrics collection inProcessSessionimplementations to include Counters, Gauges, and FlowFile handling operations.The majority of the changes relate to renaming and moving the
FlowFileEventinterface fromnifi-framework-componentstonifi-framework-api. The interface name is nowProcessSessionEvent, aligning more closely with the scope of behavior tracked. The interface itself is moved tonifi-framework-apito align with the location of theComponentMetricReporter.The addition of the
recordProcessSessionEvent()method includes a default implementation with no operations, making it compatible with existing framework extension classes and also making it optional for framework extensions.The move from
FlowFileEventtoProcessSessionEventavoids duplicative object creation, and the new method provides clean decoupling of reporting FlowFile metrics from the volatile or persistent storage of such metrics in theStatusHistoryRepository. Minor adjustments toProcessSessionEventinclude correcting the method name ofgetGarbageCollectionMillisand removing thegetAverageLineageMillis()in favor of localized calculation where needed.Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation