Hi, So maybe I should I should have asked the Q explicitly: Could we commit the patch from https://issues.apache.org/jira/browse/KAFKA-1481 now that, I hope, it's clear what problems the current MBean names can cause?
Thanks, Otis -- Monitoring * Alerting * Anomaly Detection * Centralized Log Management Solr & Elasticsearch Support * http://sematext.com/ On Mon, Sep 15, 2014 at 10:40 PM, Otis Gospodnetic < otis.gospodne...@gmail.com> wrote: > Hi, > > *Problem:* > Some Kafka 0.8.x MBeans have names composed of things like <consumer > group>-<topic>-<metric name>. Note how dashes are used as delimiters. > When <consumer group> and <topic> don't contain the delimiter character > all is good if you want to extract parts of this MBean name by simply > splitting on the delimiter character. The problem is that dashes are > allowed in topic and group names, so this splitting doesn't work. > Moreover, underscores are also used as delimiters, and they can also be > used in things like topic names. > > *Example*: > This MBean's name is composed of <consumer group>-<topic>-BytesPerSec: > > kafka.consumer:type="ConsumerTopicMetrics", name="*myGroup**-myTopic**-* > BytesPerSec" > > Here we can actually split on "-" and extract all 3 parts from the MBean > name:: > * consumer group ('*myGroup*') > * topic ('*myTopic*') > * metric (‘BytesPerSec’) > > All good! > > But imagine if I named the group: *my-Group* > And if I named the topic: *my-Topic* > > Then we'd have: > kafka.consumer:type="ConsumerTopicMetrics", name="*my-Group**-my-Topic**-* > BytesPerSec" > > Now splitting on "-" would no longer work! To extract "my-Group" and > "my-Topic" and "BytesPerSec" parts I would have to know the specific group > name and topic name to look for and could not use generic approach of just > splitting the MBean name on the delimiter. > > *Solution*: > The patch in https://issues.apache.org/jira/browse/KAFKA-1481 replaces > all _ and - characters where they are used as delimiters in MBean names > with a "|" character. Because the "I" character is not allowed in topic > names, consumer groups, host names, splitting on this new and unified > delimiter works. > > I hope this explains the problem, the solution, and that this can make it > in the next 0.8.x. > > Otis > -- > Monitoring * Alerting * Anomaly Detection * Centralized Log Management > Solr & Elasticsearch Support * http://sematext.com/ > >