You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "yashmayya (via GitHub)" <gi...@apache.org> on 2023/04/25 08:42:22 UTC

[GitHub] [kafka] yashmayya opened a new pull request, #13636: KAFKA-14933: Document Kafka Connect's log level REST APIs added in KIP-495

yashmayya opened a new pull request, #13636:
URL: https://github.com/apache/kafka/pull/13636

   - https://issues.apache.org/jira/browse/KAFKA-14933
   - [KIP-495](https://cwiki.apache.org/confluence/display/KAFKA/KIP-495%3A+Dynamically+Adjust+Log+Levels+in+Connect) added 3 REST APIs to allow dynamically adjusting (and checking) log levels on Kafka Connect workers.
   - This was added a long time ago (released in AK 2.4.0) but was never publicly documented
   - This patch documents these REST APIs in https://kafka.apache.org/documentation/#connect_rest
   
   <img width="2560" alt="Screenshot 2023-04-25 at 2 06 24 PM" src="https://user-images.githubusercontent.com/23502577/234222545-a017ce4c-5bc5-41df-a9f2-c9b459763915.png">
   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] machi1990 commented on a diff in pull request #13636: KAFKA-14933: Document Kafka Connect's log level REST APIs added in KIP-495

Posted by "machi1990 (via GitHub)" <gi...@apache.org>.
machi1990 commented on code in PR #13636:
URL: https://github.com/apache/kafka/pull/13636#discussion_r1176378206


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/LoggingResource.java:
##########
@@ -128,7 +128,7 @@ public Response getLogger(final @PathParam("logger") String namedLogger) {
      */
     @PUT
     @Path("/{logger}")
-    @Operation(summary = "Set the level for the specified logger")
+    @Operation(summary = "Set the log level for the specified logger")

Review Comment:
   good catch!



##########
docs/connect.html:
##########
@@ -328,7 +328,25 @@ <h4><a id="connect_rest" href="#connect_rest">REST API</a></h4>
         <li><code>GET /</code>- return basic information about the Kafka Connect cluster such as the version of the Connect worker that serves the REST request (including git commit ID of the source code) and the Kafka cluster ID that is connected to.
     </ul>
 
-    <p>For the complete specification of the REST API, see the <a href="/{{version}}/generated/connect_rest.yaml">OpenAPI documentation</a></p>
+    <p>The <code>admin.listeners</code> configuration can be used to configure admin REST APIs on Kafka Connect's REST API server. Similar to the <code>listeners</code> configuration, this field should contain a list of listeners in the following format: <code>protocol://host:port,protocol2://host2:port2</code>. Currently supported protocols are <code>http</code> and <code>https</code>.
+        For example:</p>
+
+    <pre class="brush: text;">
+admin.listeners=http://localhost:8080,https://localhost:8443</pre>
+
+    <p>By default, if <code>admin.listeners</code> is not configured, the admin REST APIs will be available on the regular listeners.</p>
+
+    <p>The following are the currently supported admin REST API endpoints:</p>
+
+    <ul>
+        <li><code>GET /admin/loggers</code> - list the current loggers that have their levels explicitly set and their log levels</li>
+        <li><code>GET /admin/loggers/{name}</code> - get the log level for the specified logger</li>
+        <li><code>PUT /admin/loggers/{name}</code> - set the log level for the specified logger</li>
+    </ul>
+
+    <p>See <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-495%3A+Dynamically+Adjust+Log+Levels+in+Connect">KIP-495</a> for more details about the admin logger REST APIs.</p>

Review Comment:
   should we add a note that, this only works with when log4j 1.x is used to log messages and is available on classpath and other loggers won't work, WDYT?
   



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] mimaison merged pull request #13636: KAFKA-14933: Document Kafka Connect's log level REST APIs added in KIP-495

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison merged PR #13636:
URL: https://github.com/apache/kafka/pull/13636


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] yashmayya commented on a diff in pull request #13636: KAFKA-14933: Document Kafka Connect's log level REST APIs added in KIP-495

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya commented on code in PR #13636:
URL: https://github.com/apache/kafka/pull/13636#discussion_r1176431515


##########
docs/connect.html:
##########
@@ -328,7 +328,25 @@ <h4><a id="connect_rest" href="#connect_rest">REST API</a></h4>
         <li><code>GET /</code>- return basic information about the Kafka Connect cluster such as the version of the Connect worker that serves the REST request (including git commit ID of the source code) and the Kafka cluster ID that is connected to.
     </ul>
 
-    <p>For the complete specification of the REST API, see the <a href="/{{version}}/generated/connect_rest.yaml">OpenAPI documentation</a></p>
+    <p>The <code>admin.listeners</code> configuration can be used to configure admin REST APIs on Kafka Connect's REST API server. Similar to the <code>listeners</code> configuration, this field should contain a list of listeners in the following format: <code>protocol://host:port,protocol2://host2:port2</code>. Currently supported protocols are <code>http</code> and <code>https</code>.
+        For example:</p>
+
+    <pre class="brush: text;">
+admin.listeners=http://localhost:8080,https://localhost:8443</pre>
+
+    <p>By default, if <code>admin.listeners</code> is not configured, the admin REST APIs will be available on the regular listeners.</p>
+
+    <p>The following are the currently supported admin REST API endpoints:</p>
+
+    <ul>
+        <li><code>GET /admin/loggers</code> - list the current loggers that have their levels explicitly set and their log levels</li>
+        <li><code>GET /admin/loggers/{name}</code> - get the log level for the specified logger</li>
+        <li><code>PUT /admin/loggers/{name}</code> - set the log level for the specified logger</li>
+    </ul>
+
+    <p>See <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-495%3A+Dynamically+Adjust+Log+Levels+in+Connect">KIP-495</a> for more details about the admin logger REST APIs.</p>

Review Comment:
   All the other REST APIs documented in https://kafka.apache.org/documentation/#connect_rest also seem to have a pretty brief description, so that's the pattern I followed. I made sure to include the reference to [KIP-495](https://cwiki.apache.org/confluence/display/KAFKA/KIP-495%3A+Dynamically+Adjust+Log+Levels+in+Connect) so that some of the finer details and limitations would be easily accessible. Also, since log4j 1.x is what is shipped by default in AK and is also on the classpath for Connect workers by default, I don't think we really need to call it out as an explicit limitation in the public documentation.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] machi1990 commented on a diff in pull request #13636: KAFKA-14933: Document Kafka Connect's log level REST APIs added in KIP-495

Posted by "machi1990 (via GitHub)" <gi...@apache.org>.
machi1990 commented on code in PR #13636:
URL: https://github.com/apache/kafka/pull/13636#discussion_r1176447760


##########
docs/connect.html:
##########
@@ -328,7 +328,25 @@ <h4><a id="connect_rest" href="#connect_rest">REST API</a></h4>
         <li><code>GET /</code>- return basic information about the Kafka Connect cluster such as the version of the Connect worker that serves the REST request (including git commit ID of the source code) and the Kafka cluster ID that is connected to.
     </ul>
 
-    <p>For the complete specification of the REST API, see the <a href="/{{version}}/generated/connect_rest.yaml">OpenAPI documentation</a></p>
+    <p>The <code>admin.listeners</code> configuration can be used to configure admin REST APIs on Kafka Connect's REST API server. Similar to the <code>listeners</code> configuration, this field should contain a list of listeners in the following format: <code>protocol://host:port,protocol2://host2:port2</code>. Currently supported protocols are <code>http</code> and <code>https</code>.
+        For example:</p>
+
+    <pre class="brush: text;">
+admin.listeners=http://localhost:8080,https://localhost:8443</pre>
+
+    <p>By default, if <code>admin.listeners</code> is not configured, the admin REST APIs will be available on the regular listeners.</p>
+
+    <p>The following are the currently supported admin REST API endpoints:</p>
+
+    <ul>
+        <li><code>GET /admin/loggers</code> - list the current loggers that have their levels explicitly set and their log levels</li>
+        <li><code>GET /admin/loggers/{name}</code> - get the log level for the specified logger</li>
+        <li><code>PUT /admin/loggers/{name}</code> - set the log level for the specified logger</li>
+    </ul>
+
+    <p>See <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-495%3A+Dynamically+Adjust+Log+Levels+in+Connect">KIP-495</a> for more details about the admin logger REST APIs.</p>

Review Comment:
   Thanks for the reply @yashmayya . What you said makes sense!



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] yashmayya commented on pull request #13636: KAFKA-14933: Document Kafka Connect's log level REST APIs added in KIP-495

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya commented on PR #13636:
URL: https://github.com/apache/kafka/pull/13636#issuecomment-1522043739

   Thanks Mickael!


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] yashmayya commented on pull request #13636: KAFKA-14933: Document Kafka Connect's log level REST APIs added in KIP-495

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya commented on PR #13636:
URL: https://github.com/apache/kafka/pull/13636#issuecomment-1521406022

   @C0urante @mimaison could you please take a look whenever possible?


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org