You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Ivan Yurchenko <iv...@gmail.com> on 2019/10/14 13:38:46 UTC

Log some types of API requests on broker

Hi,

I'm looking for a good way to log some broker API requests which might be
considered important. Topic deletion request is quite good an example of
such important requests.

This piece [1] is the only thing I found that remotely is what I need.
However, it logs all the requests and does it on the trace level.
Does Kafka have something like this out-of-the-box?
Thanks!

Br,
Ivan

[1]
https://github.com/apache/kafka/blob/50857b81bbaa3cd3a8ac2c460ff6e93acd3d8220/core/src/main/scala/kafka/server/KafkaApis.scala#L123

Re: Log some types of API requests on broker

Posted by Harper Henn <ha...@datto.com.INVALID>.
Hi,

Have you looked at the metrics exposed via JMX? There appears to be some
metrics around requests for topic deletion, joining and leaving a cluster,
heartbeats, etc. Here's a sample of some metrics from the "kafka.network"
domain explored via JMXTerm:

kafka.network:name=TotalTimeMs,request=CreateTopics,type=RequestMetrics
kafka.network:name=TotalTimeMs,request=DeleteAcls,type=RequestMetrics
kafka.network:name=TotalTimeMs,request=DeleteGroups,type=RequestMetrics
kafka.network:name=TotalTimeMs,request=DeleteRecords,type=RequestMetrics
kafka.network:name=TotalTimeMs,request=DeleteTopics,type=RequestMetrics
kafka.network:name=TotalTimeMs,request=DescribeAcls,type=RequestMetrics
kafka.network:name=TotalTimeMs,request=DescribeConfigs,type=RequestMetrics

Hope this helps,
Harper

On Mon, Oct 14, 2019 at 6:39 AM Ivan Yurchenko <iv...@gmail.com>
wrote:

> Hi,
>
> I'm looking for a good way to log some broker API requests which might be
> considered important. Topic deletion request is quite good an example of
> such important requests.
>
> This piece [1] is the only thing I found that remotely is what I need.
> However, it logs all the requests and does it on the trace level.
> Does Kafka have something like this out-of-the-box?
> Thanks!
>
> Br,
> Ivan
>
> [1]
>
> https://github.com/apache/kafka/blob/50857b81bbaa3cd3a8ac2c460ff6e93acd3d8220/core/src/main/scala/kafka/server/KafkaApis.scala#L123
>