You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Status

Current state: "Under Discussion"

Discussion thread: here

JIRA: KAFKA-17876 - Getting issue details... STATUS

Motivation

The metrics were originally named in the `kafka.<COMPONENT>` format but were unexpectedly altered when we moved Java classes from the `kafka.server` package to the `org.apache.kafka.server` package as part of [commit](3.7).

Subsequent developers didn’t notice this change and began using the new package name as the `metricName`. The correct naming should actually revert to `kafka.<COMPONENT>`.

This KIP aims to standardize Kafka metric naming by updating the `org.apache.kafka.server:type=AssignmentsManager` metric to follow the `kafka.<COMPONENT>` convention used by other Kafka metrics.

Public Interface

  • org.apache.kafka.server.AssignmentsManager

Proposed Changes

  • Deprecate the metric org.apache.kafka.server:type=AssignmentsManager.
  • Introduce a new metric: kafka.server:type=AssignmentsManager, consistent with other Kafka metrics.
  • This change will impact external monitoring systems that rely on the old metric name; corresponding updates will be required.

Compatibility, Deprecation, and Migration Plan

  1. Add a @Deprecated annotation to `AssignmentsManager#QUEUED_REPLICA_TO_DIR_ASSIGNMENTS_METRIC`.
  2. Update the Kafka documentation to:
    1. Note the deprecation of `org.apache.kafka.server:type=AssignmentsManager`.
    2. Introduce `kafka.server:type=AssignmentsManager` as its replacement.
  3. Introduce a new constant `AssignmentsManager#QUEUED_REPLICA_TO_DIR_ASSIGNMENTS_METRIC_NAME` with the metricName set to `kafka.server:type=AssignmentsManager`, and register it in `AssignmentsManager#metricsRegistry`.
  4. In the next major release: Remove the deprecated `AssignmentsManager#QUEUED_REPLICA_TO_DIR_ASSIGNMENTS_METRIC`. Clean it up from `AssignmentsManager#metricsRegistry`.

Test Plan

  • Add new tests to verify the new metric is correctly registered and behaves as expected.
  • Ensure backward compatibility by verifying deprecated metric behavior until removal.

Rejected Alternatives

n/a

  • No labels