|
16 | 16 |
|
17 | 17 | def messagesInPerSec = otel.mbean("kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec") |
18 | 18 | otel.instrument(messagesInPerSec, "kafka.messages.in", "number of messages in per second", |
19 | | - "1", "Count", otel.&longCounter) |
| 19 | + "1", "Count", otel.&longValueObserver) |
20 | 20 |
|
21 | 21 | def bytesInPerSec = otel.mbean("kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec") |
22 | 22 | otel.instrument(bytesInPerSec, "kafka.bytes.in", "bytes in per second from clients", |
23 | | - "by", "Count", otel.&longCounter) |
| 23 | + "by", "Count", otel.&longValueObserver) |
24 | 24 |
|
25 | 25 | def bytesOutPerSec = otel.mbean("kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec") |
26 | 26 | otel.instrument(bytesOutPerSec, "kafka.bytes.out", "bytes out per second to clients", |
27 | | - "by", "Count", otel.&longCounter) |
| 27 | + "by", "Count", otel.&longValueObserver) |
28 | 28 |
|
29 | 29 | def isrShrinksPerSec = otel.mbean("kafka.server:type=ReplicaManager,name=IsrShrinksPerSec") |
30 | 30 | otel.instrument(isrShrinksPerSec, "kafka.isr.shrinks", "in-sync replica shrinks per second", |
31 | | - "1", "Count", otel.&longCounter) |
| 31 | + "1", "Count", otel.&longValueObserver) |
32 | 32 |
|
33 | 33 | def isrExpandsPerSec = otel.mbean("kafka.server:type=ReplicaManager,name=IsrExpandsPerSec") |
34 | 34 | otel.instrument(isrExpandsPerSec, "kafka.isr.expands", "in-sync replica expands per second", |
35 | | - "1", "Count", otel.&longCounter) |
| 35 | + "1", "Count", otel.&longValueObserver) |
36 | 36 |
|
37 | 37 | def maxLag = otel.mbean("kafka.server:type=ReplicaFetcherManager,name=MaxLag,clientId=Replica") |
38 | 38 | otel.instrument(maxLag, "kafka.max.lag", "max lag in messages between follower and leader replicas", |
39 | | - "1", "Value", otel.&longUpDownCounter) |
| 39 | + "1", "Value", otel.&longValueObserver) |
40 | 40 |
|
41 | 41 | def activeControllerCount = otel.mbean("kafka.controller:type=KafkaController,name=ActiveControllerCount") |
42 | 42 | otel.instrument(activeControllerCount, "kafka.controller.active.count", "controller is active on broker", |
43 | | - "1", "Value", otel.&longUpDownCounter) |
| 43 | + "1", "Value", otel.&longValueObserver) |
44 | 44 |
|
45 | 45 | def offlinePartitionsCount = otel.mbean("kafka.controller:type=KafkaController,name=OfflinePartitionsCount") |
46 | 46 | otel.instrument(offlinePartitionsCount, "kafka.partitions.offline.count", "number of partitions without an active leader", |
47 | | - "1", "Value", otel.&longUpDownCounter) |
| 47 | + "1", "Value", otel.&longValueObserver) |
48 | 48 |
|
49 | 49 | def underReplicatedPartitionsCount = otel.mbean("kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions") |
50 | 50 | otel.instrument(underReplicatedPartitionsCount, "kafka.partitions.underreplicated.count", "number of under replicated partitions", |
51 | | - "1", "Value", otel.&longUpDownCounter) |
| 51 | + "1", "Value", otel.&longValueObserver) |
52 | 52 |
|
53 | 53 | def leaderElectionRate = otel.mbean("kafka.controller:type=ControllerStats,name=LeaderElectionRateAndTimeMs") |
54 | 54 | otel.instrument(leaderElectionRate, "kafka.leader.election.rate", "leader election rate - non-zero indicates broker failures", |
55 | | - "1", "Count", otel.&longCounter) |
| 55 | + "1", "Count", otel.&longValueObserver) |
56 | 56 |
|
57 | 57 | def uncleanLeaderElections = otel.mbean("kafka.controller:type=ControllerStats,name=UncleanLeaderElectionsPerSec") |
58 | 58 | otel.instrument(uncleanLeaderElections, "kafka.unclean.election.rate", "unclean leader election rate - non-zero indicates broker failures", |
59 | | - "1", "Count", otel.&longCounter) |
| 59 | + "1", "Count", otel.&longValueObserver) |
60 | 60 |
|
61 | 61 | def requestQueueSize = otel.mbean("kafka.network:type=RequestChannel,name=RequestQueueSize") |
62 | 62 | otel.instrument(requestQueueSize, "kafka.request.queue", "size of the request queue", |
63 | | - "1", "Value", otel.&longUpDownCounter) |
| 63 | + "1", "Value", otel.&longValueObserver) |
64 | 64 |
|
65 | 65 | def fetchConsumer = otel.mbean("kafka.network:type=RequestMetrics,name=TotalTimeMs,request=FetchConsumer") |
66 | 66 | otel.instrument(fetchConsumer, "kafka.fetch.consumer.total.time.count", "fetch consumer request count", |
67 | | - "1", "Count", otel.&longCounter) |
| 67 | + "1", "Count", otel.&longSumObserver) |
68 | 68 | otel.instrument(fetchConsumer, "kafka.fetch.consumer.total.time.median", "fetch consumer request time - 50th percentile", |
69 | | - "ms", "50thPercentile", otel.&doubleUpDownCounter) |
| 69 | + "ms", "50thPercentile", otel.&doubleValueObserver) |
70 | 70 | otel.instrument(fetchConsumer, "kafka.fetch.consumer.total.time.99p", "fetch consumer request time - 99th percentile", |
71 | | - "ms", "99thPercentile", otel.&doubleUpDownCounter) |
| 71 | + "ms", "99thPercentile", otel.&doubleValueObserver) |
72 | 72 |
|
73 | 73 | def fetchFollower = otel.mbean("kafka.network:type=RequestMetrics,name=TotalTimeMs,request=FetchFollower") |
74 | 74 | otel.instrument(fetchFollower, "kafka.fetch.follower.total.time.count", "fetch follower request count", |
75 | | - "1", "Count", otel.&longCounter) |
| 75 | + "1", "Count", otel.&longSumObserver) |
76 | 76 | otel.instrument(fetchFollower, "kafka.fetch.follower.total.time.median", "fetch follower request time - 50th percentile", |
77 | | - "ms", "50thPercentile", otel.&doubleUpDownCounter) |
| 77 | + "ms", "50thPercentile", otel.&doubleValueObserver) |
78 | 78 | otel.instrument(fetchFollower, "kafka.fetch.follower.total.time.99p", "fetch follower request time - 99th percentile", |
79 | | - "ms", "99thPercentile", otel.&doubleUpDownCounter) |
| 79 | + "ms", "99thPercentile", otel.&doubleValueObserver) |
80 | 80 |
|
81 | 81 | def produce = otel.mbean("kafka.network:type=RequestMetrics,name=TotalTimeMs,request=Produce") |
82 | 82 | otel.instrument(produce, "kafka.produce.total.time.count", "produce request count", |
83 | | - "1", "Count", otel.&longCounter) |
| 83 | + "1", "Count", otel.&longSumObserver) |
84 | 84 | otel.instrument(produce, "kafka.produce.total.time.median", "produce request time - 50th percentile", |
85 | | - "ms", "50thPercentile", otel.&doubleUpDownCounter) |
| 85 | + "ms", "50thPercentile", otel.&doubleValueObserver) |
86 | 86 | otel.instrument(produce, "kafka.produce.total.time.99p", "produce request time - 99th percentile", |
87 | | - "ms", "99thPercentile", otel.&doubleUpDownCounter) |
| 87 | + "ms", "99thPercentile", otel.&doubleValueObserver) |
88 | 88 |
|
89 | 89 | def logFlushRate = otel.mbean("kafka.log:type=LogFlushStats,name=LogFlushRateAndTimeMs") |
90 | 90 | otel.instrument(logFlushRate, "kafka.logs.flush.time.count", "log flush count", |
91 | | - "1", "Count", otel.&longCounter) |
| 91 | + "1", "Count", otel.&longSumObserver) |
92 | 92 | otel.instrument(logFlushRate, "kafka.logs.flush.time.median", "log flush time - 50th percentile", |
93 | | - "ms", "50thPercentile", otel.&doubleUpDownCounter) |
| 93 | + "ms", "50thPercentile", otel.&doubleValueObserver) |
94 | 94 | otel.instrument(logFlushRate, "kafka.logs.flush.time.99p", "log flush time - 99th percentile", |
95 | | - "ms", "99thPercentile", otel.&doubleUpDownCounter) |
| 95 | + "ms", "99thPercentile", otel.&doubleValueObserver) |
0 commit comments