Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kafka.request.time.avg #1135

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions jmx-metrics/docs/target-systems/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ These metrics are sourced from Kafka's exposed Yammer metrics for each instance:
* Attributes: `type`
* Instrument Type: DoubleValueObserver

* Name: `kafka.request.time.avg`
* Description: The average time the broker has taken to service requests
* Unit: `ms`
* Attributes: `type`
* Instrument Type: DoubleValueObserver

* Name: `kafka.network.io`
* Description: The bytes received or sent by the broker
* Unit: `by`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ List<Consumer<Metric>> kafkaBrokerAssertions() {
attrs -> attrs.containsOnly(entry("type", "produce")),
attrs -> attrs.containsOnly(entry("type", "fetchfollower")),
attrs -> attrs.containsOnly(entry("type", "fetchconsumer"))),
metric ->
assertGaugeWithAttributes(
metric,
"kafka.request.time.avg",
"The average time the broker has taken to service requests",
"ms",
attrs -> attrs.containsOnly(entry("type", "produce")),
attrs -> attrs.containsOnly(entry("type", "fetchfollower")),
attrs -> attrs.containsOnly(entry("type", "fetchconsumer"))),
metric ->
assertGauge(
metric,
Expand Down
10 changes: 8 additions & 2 deletions jmx-metrics/src/main/resources/target-systems/kafka.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ otel.instrument(requestTime,
"type" : { mbean -> mbean.name().getKeyProperty("request").toLowerCase() },
],
"99thPercentile", otel.&doubleValueCallback)


otel.instrument(requestTime,
"kafka.request.time.avg",
"The average time the broker has taken to service requests",
"ms",
[
"type" : { mbean -> mbean.name().getKeyProperty("request").toLowerCase() },
],
"Mean", otel.&doubleValueCallback)

def network = otel.mbeans(["kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec",
"kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec"])
Expand Down
Loading