Skip to content

Commit

Permalink
KAFKA-2730: use thread-id as metrics tags
Browse files Browse the repository at this point in the history
Author: Guozhang Wang <[email protected]>

Reviewers: Gwen Shapira

Closes apache#416 from guozhangwang/K2730
  • Loading branch information
guozhangwang authored and gwenshap committed Nov 4, 2015
1 parent aa73554 commit c30ee50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ class ReplicaFetcherThread(name: String,

private val sourceNode = new Node(sourceBroker.id, sourceBroker.host, sourceBroker.port)

// we need to include the full thread id composed of the broker and the thread index
// as the metrics tag to avoid metric name conflicts with more than one thread to the same broker
private val networkClient = {
val selector = new Selector(
NetworkReceive.UNLIMITED,
brokerConfig.connectionsMaxIdleMs,
metrics,
time,
"replica-fetcher",
Map("broker-id" -> sourceBroker.id.toString).asJava,
Map("thread-id" -> name).asJava,
false,
ChannelBuilders.create(brokerConfig.interBrokerSecurityProtocol, Mode.CLIENT, LoginType.SERVER, brokerConfig.values)
)
Expand Down

0 comments on commit c30ee50

Please sign in to comment.