[ 
https://issues.apache.org/jira/browse/NIFI-15979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18088668#comment-18088668
 ] 

ASF subversion and git services commented on NIFI-15979:
--------------------------------------------------------

Commit 0ef04bc95c9b3946d51bc76d948250f2d34f3318 in nifi's branch 
refs/heads/main from Kevin Doran
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=0ef04bc95c9 ]

NIFI-15979 Wire Connector MDC and reporting-task visibility (#11330)

Surface Connector observability that was part of nifi-api 2.9.0:
- ConnectorNode.getLoggingAttributes() plus 
StandardConnectorNode/StandardProcessGroup
  propagation of connector identity into descendant-component MDC.
- StandardEventAccess.getConnectorStatuses() returns a ConnectorStatus (id, 
name, root
  group status) per connector; StatusHistoryRepository gains a capture overload 
accepting
  Collection<ConnectorStatus>; FlowController invokes it.

> Add ConnectorStatus for Reporting
> ---------------------------------
>
>                 Key: NIFI-15979
>                 URL: https://issues.apache.org/jira/browse/NIFI-15979
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework, NiFi API
>            Reporter: Kevin Doran
>            Assignee: Kevin Doran
>            Priority: Major
>             Fix For: nifi-api-2.9.0
>
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> NIFI-14991 wired Process Group identity into the SLF4J MDC for every 
> component log, but it has no concept of a `Connector` (it pre-dates that 
> feature). As a result:
>  - Logs from inside a connector-managed flow carry `processGroupId/Name/Path` 
> but
>   nothing identifying the owning connector or its NAR bundle. The connector's 
> own
>   log lines emit no MDC at all (`ExtensionBuilder.buildConnector` constructs 
> the
>   `ComponentLog` with the no-arg `StandardLoggingContext`).
>  - Reporting tasks that walk `EventAccess.getControllerStatus()` never see
>   connector-managed Process Groups — they have no parent and live in
>   `ConnectorRepository`, separate from the root group.
>  - A connector implementation has no way to surface custom logging context
>   (e.g. source schema, table namespace).
> +*What changes*+
> *nifi-api* (Covered by NIP-11)
>  - `ConnectorInitializationContext.setLoggingAttributes(Map<String, String>)` 
> —
>   new `default` method; `AbstractConnector` provides a `protected` helper.
>  - `ProcessGroupStatus` — new `loggingAttributes` field (`Map.of()` default),
>   included in `clone()` / `merge()`.
>  - `EventAccess.getConnectorStatuses()` — new `default` returning empty;
>   implementations override.
> *NiFi Framework*
>  - `StandardConnectorNode` holds a `loggingAttributes` map, implements
>   `GroupedComponent`, and is initialized with reserved framework keys:
>   `connectorId`, `connectorName`, `connectorComponent` (FQN, mirroring the
>   existing processor `component` convention), and
>   `connectorBundleGroup`/`Artifact`/`Version` from the bundle coordinate.
>  - Reserved keys cannot be overridden by `setLoggingAttributes`; collisions 
> are
>   dropped with a single WARN. A second WARN fires when a connector sets more
>   than ~10 custom keys, to surface cardinality risk.
>  - `StandardProcessGroup.setLoggingAttributes()` merges the owning connector's
>   keys and recurses into descendants, so every component inside the managed
>   flow inherits them without needing to know about Connectors.
>  - `ExtensionBuilder.buildConnector` (and the ghost path) now constructs
>   `SimpleProcessLogger` with a `StandardLoggingContext` bound to the
>   `StandardConnectorNode` via the existing `setComponent` late-bind path.
>  - `AbstractEventAccess.createProcessGroupStatus` snapshots
>   `group.getLoggingAttributes()` onto the status DTO.
>   `AbstractEventAccess.getConnectorStatuses()` walks the Connector registry 
> and
>   returns one status per managed root.
> +*Tests + docs*+
> Unit tests for framework keys, propagation into inner components,
> reserved-key filtering, `setName` updates, and the new `EventAccess` methods.
> Short `administration-guide.adoc` section listing the new keys alongside the
> NIFI-14991 documentation.
> +*Delivery*+
> Two PRs:
>  # `nifi-api`: BW-compatible additions only (default impls / optional DTO 
> field; no behavior change).
>  # `nifi`: Framework wiring + tests + docs.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to