Skip to content

Commit

Permalink
[LI-FIXUP] Enhance metrics tag for BrokerToControllerRequestManagers (
Browse files Browse the repository at this point in the history
#454)

This should be a direct fix-up to the commit
- e37eaa0 [LI-HOTFIX] Add observability into AlterIsrManager (#453)

EXIT_CRITERIA = When the corresponding commit is dropped

Using this tag, the `kafka-server` can generate inGraph metrics for both `DefaultAlterIsrManager` and `TransferLeaderManager` (or even future broker-to-controller channel) together with one regex query
```
"kafka.server:type=*,name=*,requestManagerCategory=BrokerToControllerRequestManager"
```
  • Loading branch information
lmr3796 authored Apr 25, 2023
1 parent e37eaa0 commit 79501dc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ abstract class AbstractBrokerToControllerRequestManager[Item <: BrokerToControll
private val inflightRequest: AtomicBoolean = new AtomicBoolean(false)

// Additional observability into the internal states
private val baseMetricTags = Map("class" -> getClass.getName)
private val baseMetricTags = Map("requestManagerCategory" -> BrokerToControllerRequestManager.getClass.getSimpleName.replaceAll("\\$$", ""))
@volatile private var lastInflightRequestLockTimeMs = time.milliseconds()
@VisibleForTesting private[server] val unsentItemQueueSizeGauge = newGauge("unsentItemQueueSize", () => unsentItemQueue.size, baseMetricTags)
@VisibleForTesting private[server] val inflightRequestGauge = newGauge("inflightRequest", () => if (inflightRequest.get()) 1 else 0, baseMetricTags)
Expand Down

0 comments on commit 79501dc

Please sign in to comment.