Skip to content

Commit

Permalink
fix(kafka): fix incorrect metrics (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
YangKian authored Dec 8, 2023
1 parent fcc2396 commit 10a8f24
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hstream-kafka/HStream/Kafka/Metrics/ConsumeStats.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ totalConsumeRequest =

consumerGroupCommittedOffsets :: P.Vector P.Label3 P.Gauge
consumerGroupCommittedOffsets =
P.unsafeRegister . P.vector ("group", "topicName", "partition") . P.gauge $
P.unsafeRegister . P.vector ("consumer_group", "topicName", "partition") . P.gauge $
P.Info "consumer_group_committed_offset" "Latest committed offset for a consumer group"
{-# NOINLINE consumerGroupCommittedOffsets #-}
2 changes: 1 addition & 1 deletion hstream-kafka/HStream/Kafka/Metrics/ProduceStats.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ totalProduceRequest =
totalFailedProduceRequest :: P.Vector P.Label2 P.Counter
totalFailedProduceRequest =
P.unsafeRegister . P.vector ("topicName", "partition") . P.counter $
P.Info "total_produce_request" "Total failed produce request for a topic"
P.Info "total_failed_produce_request" "Total failed produce request for a topic"
{-# NOINLINE totalFailedProduceRequest #-}
2 changes: 1 addition & 1 deletion hstream-kafka/HStream/Kafka/Server/Handler/Consume.hs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ handleFetch ServerContext{..} _ r = K.catchFetchResponseEx $ do
if r.maxWaitMs > defTimeout
then do
S.readerSetTimeout reader defTimeout
rs1 <- S.readerRead reader storageOpts.fetchMaxLen
rs1 <- P.observeDuration readLatencySnd $ S.readerRead reader storageOpts.fetchMaxLen
let size = sum (map (K.recordBytesSize . (.recordPayload)) rs1)
if size >= fromIntegral r.minBytes
then pure rs1
Expand Down

0 comments on commit 10a8f24

Please sign in to comment.