Getting kafka metrics using go sarama library

Viewed 397

I've been trying to get kafka broker metrics using go sarama library and I have few concerns.

I initialized a sarama config using sarama.NewConfig() with the version as sarama.V2_0_0_0 and I used this config to obtain metrics as mentioned in their doc

`metrics.GetOrRegisterMeter("incoming-byte-rate", config.MetricRegistry).RateMean()`
  1. Does this provide the total incoming byte rate including all the incoming messages? Because I compared this value with lenses and other tools but it is totally different (same for "outgoing-byte-rate" and "request-rate". I suppose this request rate implies the message rate).

  2. Unlike RateMean() function, Rate1(), Rate5() and Rate15() return only 0 though there's plenty of activity in the kafka cluster. Do you know any reason for this?

  3. I used metrics.GetOrRegisterMeter(fmt.Sprintf("incoming-byte-rate-for-broker-%v", broker.ID()), config.MetricRegistry).RateMean() to get broker level metrics as mentioned in the doc but I only received 0.

I'd really appreciate if someone can help me out here and enlighten me on these concerns. Thanks in advance. :)

0 Answers
Related