Skip to content

Getting kafka metrics #1660

@YasiruR

Description

@YasiruR

0

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 your 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 (same for other broker level metrics as well).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions