NIFI-15508 Add Record Gauge support to Standard Process Session#10813
Closed
exceptionfactory wants to merge 3 commits intoapache:mainfrom
Closed
NIFI-15508 Add Record Gauge support to Standard Process Session#10813exceptionfactory wants to merge 3 commits intoapache:mainfrom
exceptionfactory wants to merge 3 commits intoapache:mainfrom
Conversation
652270b to
945d6da
Compare
- Added ComponentMetricReporter to Framework API - Added application property for configuring ComponentMetricReporter - Added getGaugeValues method to TestRunner
945d6da to
ab028a9
Compare
pvillard31
reviewed
Jan 28, 2026
| void adjustCounter(String name, long delta); | ||
|
|
||
| void recordGauge(GaugeRecord gaugeRecord); | ||
|
|
Contributor
There was a problem hiding this comment.
What about also adding
Suggested change
| ComponentMetricContext getComponentMetricContext(); |
Then
// In AbstractRepositoryContext.java, add:
@Override
public ComponentMetricContext getComponentMetricContext() {
return componentMetricContext;
}Then you could remove
// in StandardProcessSession.java:
private final ComponentMetricContext componentMetricContext;
// in StandardProcessSession constructor:
final Connectable connectable = context.getConnectable();
final Map<String, String> groupAttributes = connectable.getProcessGroup().getLoggingAttributes();
componentMetricContext = new ComponentMetricContext(connectable.getIdentifier(), connectable.getName(), connectable.getComponentType(), groupAttributes);and in recordGauge() method, use
final GaugeRecord gaugeRecord = new GaugeRecord(name, value, recorded, context.getComponentMetricContext());Thoughts?
Contributor
Author
There was a problem hiding this comment.
Thanks for recommendation, that is a helpful improvement!
pvillard31
previously approved these changes
Jan 28, 2026
Contributor
pvillard31
left a comment
There was a problem hiding this comment.
LGTM, just left one minor comment, but not a blocker
pvillard31
approved these changes
Jan 29, 2026
mark-bathori
pushed a commit
to mark-bathori/nifi
that referenced
this pull request
Feb 5, 2026
- Added ComponentMetricReporter to Framework API - Added application property for configuring ComponentMetricReporter - Added getGaugeValues method to TestRunner This closes apache#10813. Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>
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-15508 Adds initial support for recording Gauge values through the
StandardProcessSessionandMockProcessSessionimplementations based on NiFi API 2.6.0.The standard Session introduces the
ComponentMetricReporteras a framework extension, supporting export of both Gauge and Counter values. A new application property namednifi.component.metric.reporter.implementationdefines the class implementing theComponentMetricReporterinterface. The default value is blank.The mock Session records Gauge values in memory. The
TestRunnernow includes a method namedgetGaugeValues()to retrieve a list of values that a Processor records inonTriggerinvocations.Changes include a new system test with a basic implementation of the
ComponentMetricReporterthat exercises both framework configuration and Gauge recording.These changes provide the foundation for subsequent framework changes, which could include persisting Gauge values along with Counter values for retrieval from the NiFi REST API and visualization through the NiFi UI.
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