apoorvmittal10 commented on code in PR #14560: URL: https://github.com/apache/kafka/pull/14560#discussion_r1361305203
########## clients/src/main/java/org/apache/kafka/clients/admin/Admin.java: ########## @@ -1660,6 +1662,34 @@ default FenceProducersResult fenceProducers(Collection<String> transactionalIds) FenceProducersResult fenceProducers(Collection<String> transactionalIds, FenceProducersOptions options); + /** + * Determines the client's unique client instance ID used for telemetry. This ID is unique to + * this specific client instance and will not change after it is initially generated. + * The ID is useful for correlating client operations with telemetry sent to the broker and + * to its eventual monitoring destination(s). + * + * If telemetry is enabled, this will first require a connection to the cluster to generate + * the unique client instance ID. This method waits up to {@code timeout} for the admin + * client to complete the request. + * + * If telemetry is disabled, the method will throw {@link IllegalStateException}. + * + * Client telemetry is controlled by the {@link AdminClientConfig#ENABLE_METRICS_PUSH_CONFIG} + * configuration option. + * + * @param timeout The maximum time to wait for admin client to determine its client instance ID. + * The value should be non-negative. Specifying a timeout of zero means do not + * wait for the initial request to complete if it hasn't already. + * @throws InterruptException If the thread is interrupted while blocked. + * @throws KafkaException If an unexpected error occurs while trying to determine the client + * instance ID, though this error does not necessarily imply the + * admin client is otherwise unusable. + * @throws IllegalArgumentException If the {@code timeout} is negative. + * @throws IllegalStateException If telemetry is not enabled. + * @return The client's assigned instance id used for metrics collection. + */ + String clientInstanceId(Duration timeout); Review Comment: My bad, corrected everywhere. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org