KafkaEx consumers not showing up on Strimzi Kafka Exporter

Posted on July 22, 2023
Tags: elixir

If you are using (kafka_ex)[https://github.com/kafkaex/kafka_ex] and your consumers are not showing up on the strimzi kafka exporter dashboard on grafana then make sure that:

  1. The client is set to kayrock
# in config.exs
config :kafka_ex,
  brokers: [
    {"localhost", 9092}
  ],
  # [...]
  kafka_version: "kayrock"
  # [...]
  1. you pass the correct api_versions to your consumers

@kafka_api_version %{offset_fetch: 3, offset_commit: 3, fetch: 3}


children = [
        %{
          start:
            {KafkaEx.ConsumerGroup, :start_link,
             [
               YourConsumer,
               "consumer-group",
               ["topic"],
               [api_versions: @kafka_api_version]
             ]},
          id: YourConsumer
        }
]

Now you should your consumer metrics in the grafana dashboard