NIFI-15979 Add Connector reporting-task visibility#89
Conversation
- ConnectorInitializationContext.setLoggingAttributes(Map): new default method (throws UOE) for connectors to surface custom MDC context. - AbstractConnector.setLoggingAttributes(Map): protected helper forwarding to the init context. - ProcessGroupStatus.loggingAttributes: snapshot map (default Map.of()) plus accessors; propagated through clone() and merge(). - EventAccess.getConnectorStatuses(): new default method returning an empty collection; implementations override to expose connector-managed Process Groups to reporting tasks. Pure API additions with default impls keep existing code compiling unchanged.
ffd0870 to
ff83ed2
Compare
|
Thanks for the review @markap14! I accepted all suggestions. |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for putting this together @kevdoran. The changes look good for Connector Status. The addition of an open-ended way to set logging attributes is more concerning, and does not seem to align with the existing goal of framework-managed attributes. Instead of an open-ended Map of attributes, it seems better to extend the MDC set of attributes at the framework level, based on declared Connector properties.
| if (initializationContext == null) { | ||
| throw new IllegalStateException("Connector has not been initialized"); | ||
| } | ||
|
|
There was a problem hiding this comment.
This change appears unnecessary
| * @param attributes the custom attributes to expose on logs from this Connector and its managed flow; must not be {@code null} | ||
| * @throws UnsupportedOperationException if the runtime implementation does not support custom logging attributes | ||
| */ | ||
| default void setLoggingAttributes(Map<String, String> attributes) { |
There was a problem hiding this comment.
This method is very open-ended, and moves in a different direction from the current framework-controlled Logging Attributes in a Process Group. Rather than exposing it as a point of extension, it seems better to maintain a strategy of declared properties, which the framework handles for inclusion.
The blank line between the null-check and the return statement in getInitializationContext() was inadvertently removed in an earlier revision of this branch and not restored when the surrounding helper method was dropped. Addresses review feedback on PR apache#89. Co-authored-by: Cursor <cursoragent@cursor.com>
Per review feedback, remove the loggingAttributes snapshot field, its accessors, and the associated clone()/merge() plumbing from ProcessGroupStatus. The remaining ConnectorStatus type and EventAccess.getConnectorStatuses() provide connector identity to reporting consumers without adding a logging-attributes map to the Process Group status. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
NIFI-15979
These API changes relate to NIP-30
Pure API additions with default impls keep existing code compiling unchanged.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranch