[ 
https://issues.apache.org/jira/browse/KAFKA-1723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14270163#comment-14270163
 ] 

Jay Kreps commented on KAFKA-1723:
----------------------------------

2. I think you are saying that sensor names are still strings not compounds. I 
think this makes sense according to your proposal.
3. We really can't make client id mandatory as most people don't set it and 
forcing them will be quite annoying. We can definitely set some default like 
"producer", though. There is no guarantee that client id is unique, of course. 
But people who have multiple producers can set different client ids to 
distinguish them.

Another question: How are you supposed to make use of the .metrics() api on the 
producer and consumer now? Previously the idea was that you could do something 
like
{code}
   if(producer.metrics.get("my.metric.name") > MAXIMUM)
       alert("This is bad!");
{code}
But now this use case is a bit mixed up, right? As now the full name is an 
object which is a bit hard to construct. So would you do something like:
{code}
  Map<String, String> tags = new HashMap<String, String>();
  tags.put("clientId", "my-id");
  MetricName name = new MetricName("my.metric.name", "my-group", tags);
  if(producer.metrics.get("my.metric.name") > MAXIMUM)
    alert("This is bad!");
{code}
This is a bit awkward, right? Is there anything we can do to simplify usage?

Also, in this patch the metric names are lower case and dash separated but the 
metric groups and tag names are camel case. That seems pretty odd. Perhaps we 
could make them all lower case and dash separated? E.g. new 
MetricName("record-send-rate", "producer-metrics", Map("client-id", "foo"))


> make the metrics name in new producer more standard
> ---------------------------------------------------
>
>                 Key: KAFKA-1723
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1723
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: clients
>    Affects Versions: 0.8.2
>            Reporter: Jun Rao
>            Assignee: Manikumar Reddy
>            Priority: Blocker
>             Fix For: 0.8.2
>
>         Attachments: KAFKA-1723.patch, KAFKA-1723_2015-01-08_21:41:13.patch, 
> KAFKA-1723_2015-01-08_22:02:22.patch
>
>
> The jmx name in the new producer looks like the following:
> kafka.producer.myclientid:type=mytopic
> However, this can be ambiguous since we allow "." in client id and topic.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to