Skip to content

NIFI-16321 Add Attribute Handling for Counters and Gauges - #11648

Merged
pvillard31 merged 1 commit into
apache:mainfrom
exceptionfactory:NIFI-16231
Sep 9, 2026
Merged

pvillard31 merged 1 commit into
apache:mainfrom
exceptionfactory:NIFI-16231

Conversation

@exceptionfactory

@exceptionfactory exceptionfactory commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

NIFI-16321 Adds handling for the Map of attributes to the adjustCounter and recordGauge methods in implementations of ProcessSession across the application.

Changes incorporate upgrading the NiFi API from 2.11.0 to 2.12.0, introducing the new signatures for the metrics tracking methods. Adjustments include modifications to several tests to verify handling of attributes passed to these ProcessSession methods.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@exceptionfactory exceptionfactory changed the title NIFI-16231 Add Attribute Handling for Counters and Gauges NIFI-16311 Add Attribute Handling for Counters and Gauges Sep 8, 2026
@exceptionfactory exceptionfactory changed the title NIFI-16311 Add Attribute Handling for Counters and Gauges NIFI-16321 Add Attribute Handling for Counters and Gauges Sep 8, 2026
@exceptionfactory
exceptionfactory force-pushed the NIFI-16231 branch 3 times, most recently from ce4d7a4 to 9d492b2 Compare September 8, 2026 19:25
- Upgraded NiFi API from 2.11.0 to 2.12.0
- Added new adjustCounter and recordGauge methods to ProcessSession classes
@joewitt

joewitt commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The PR body is NIFI-16321. Text is 16321, link is 16231 (Pierre’s dependency bump, already resolved). The feature branch is also named NIFI-16231. Easy copy-paste; worth fixing the markdown so Jira/GitHub linking is not a mess. Branch rename is optional.

@joewitt

joewitt commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Mock runner never exercises session-committed counters. testAdjustCounter always uses true / CommitTiming.NOW. Gauges have both NOW and SESSION_COMMITTED. StandardProcessSessionTest covers commit-time counters; MockProcessSession does not. A one-liner processor that calls adjustCounter(..., CommitTiming.SESSION_COMMITTED) would catch a commit/rollback bug in the mock.

SharedSessionState.getGaugeValues(name) returns a live ArrayList; the attributed overload returns List.copyOf. Callers of the old method can mutate the store. Pre-existing flavor of leak, now more visible. Cheap to return List.copyOf(gaugeValues) on both.

@exceptionfactory

Copy link
Copy Markdown
Contributor Author

The PR body is NIFI-16321. Text is 16321, link is 16231 (Pierre’s dependency bump, already resolved). The feature branch is also named NIFI-16231. Easy copy-paste; worth fixing the markdown so Jira/GitHub linking is not a mess. Branch rename is optional.

Thanks, yes, I noticed this after I opened the pull request, then fixed the commit and description, although the branch name is the same, but that is transitory.

@pvillard31 pvillard31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are looking good, thanks @exceptionfactory

@pvillard31
pvillard31 merged commit 7a5b4dd into apache:main Sep 9, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants