You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/12/30 09:50:25 UTC

[GitHub] [kafka] kamalcph opened a new pull request, #13060: MINOR: Fix JMX tool to handle the object names with wild cards and optional attributes

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

   JMX tool doesn't handle the object names with wild card. The below exceptions are thrown:
   
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,*
   ```
    Trying to connect to JMX url: service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi.
   Exception in thread "main" java.lang.NullPointerException
   	at kafka.tools.JmxTool$.main(JmxTool.scala:194)
   	at kafka.tools.JmxTool.main(JmxTool.scala)
   ```
   
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,* --attributes Count,FifteenMinuteRate 
   ```
   Trying to connect to JMX url: service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi. Exception in thread "main" java.lang.NullPointerException
   	at kafka.tools.JmxTool$.queryAttributes(JmxTool.scala:254)
   	at kafka.tools.JmxTool$.main(JmxTool.scala:214)
   	at kafka.tools.JmxTool.main(JmxTool.scala)
   ```
   
   Since JMX tool is not covered with tests, verified the patch with the below combinations:
   
   **Specific MBean name**
   ```
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec --attributes Count,FifteenMinuteRate 
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec --object-name kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec 
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec --object-name kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec --attributes Count,FifteenMinuteRate
   
   ```
   **Domain Pattern** (not supported -- throws java.lang.NoClassDefFoundError: kafka/log/LogSegments$ -- needs further fix) 
   ```
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.*:* 
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.*:* --attributes Count,FifteenMinuteRate
   ```
   
   **Property List pattern**
   ```
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,* 
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,* --attributes Count,FifteenMinuteRate
   
   ```
   **Property Value pattern**
   ```
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,name=*InPerSec 
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=BrokerTopicMetrics,name=*InPerSec --attributes Count,FifteenMinuteRate
   
   ```
   **Property pattern: (combination of list & value patterns)** 
   ```
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=*,* 
   ❯ sh kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi --object-name kafka.server:type=*,* --attributes Count,FifteenMinuteRate
   
   ```
   
   ### 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] kamalcph commented on pull request #13060: KAFKA-14559: Fix JMX tool to handle the object names with wild cards and optional attributes

Posted by GitBox <gi...@apache.org>.
kamalcph commented on PR #13060:
URL: https://github.com/apache/kafka/pull/13060#issuecomment-1382263830

   @ijuma @showuon @mimaison 
   
   Ping for review!


-- 
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 commented on pull request #13060: KAFKA-14559: Fix JMX tool to handle the object names with wild cards and optional attributes

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

   Thanks for the PR! We're moving JmxTool to the tools module in https://github.com/apache/kafka/pull/13136. Let's do the rewrite/move first, then I'll take a look at this PR.


-- 
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] satishd merged pull request #13060: KAFKA-14559: Fix JMX tool to handle the object names with wild cards and optional attributes

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


-- 
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] kamalcph commented on pull request #13060: KAFKA-14559: Fix JMX tool to handle the object names with wild cards and optional attributes

Posted by GitBox <gi...@apache.org>.
kamalcph commented on PR #13060:
URL: https://github.com/apache/kafka/pull/13060#issuecomment-1376779303

   @showuon @mimaison
   ping for the review!


-- 
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] kamalcph commented on pull request #13060: KAFKA-14559: Fix JMX tool to handle the object names with wild cards and optional attributes

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

   @fvaleri @mimaison @showuon @satishd 
   
   Updated the patch with the Java JMX tool. Currently, the tool fails when using the pattern in the Object name. Covered the patch with the unit tests. Please take a look!


-- 
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] satishd commented on pull request #13060: KAFKA-14559: Fix JMX tool to handle the object names with wild cards and optional attributes

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

   There were a couple of test failures that are unrelated to this PR, will merge to trunk. 


-- 
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] kamalcph commented on pull request #13060: KAFKA-14559: Fix JMX tool to handle the object names with wild cards and optional attributes

Posted by GitBox <gi...@apache.org>.
kamalcph commented on PR #13060:
URL: https://github.com/apache/kafka/pull/13060#issuecomment-1398673057

   @ijuma @showuon 
   Please take a look when you get chance.


-- 
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] kamalcph commented on pull request #13060: MINOR: Fix JMX tool to handle the object names with wild cards and optional attributes

Posted by GitBox <gi...@apache.org>.
kamalcph commented on PR #13060:
URL: https://github.com/apache/kafka/pull/13060#issuecomment-1367826069

   @showuon @chia7712 
   Please take a look when you get a chance. Thanks!


-- 
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