hey, i tried to use the adminclient to get statistics but the "topic" property ist empty,
what i am doing wrong or is this a bug ?

public class KafkaTest
{
public KafkaTest()
{
var config = new AdminClientConfig()
{
ClientId = "admin-client-stats",
BootstrapServers = Configuration.KafkaBootstrapServer,
StatisticsIntervalMs = 10000,
Debug = "broker,topic,msg"
};
var adminClient = new AdminClientBuilder(config)
.SetStatisticsHandler(StatsHandler)
.Build();
}
private void StatsHandler(AdminClient sender, string json)
{
Console.WriteLine(json);
}
}
Please provide the following information:
the admin client doesn't read/write to topics, so there is nothing to report. this will be populated on producers/consumers only.
i also tried a consumer and got the same result ( topic empty )
(didnt have the code actually, so free from the head... )
public class KafkaTest
{
public KafkaTest()
{
var config = new ConsumerConfig()
{
GroupId = "<service-name>",
BootstrapServers = Configuration.KafkaBootstrapServer,
StatisticsIntervalMs = 10000
};
var consumer = new ConsumerBuilder<TKey,TValue>(config)
.SetStatisticsHandler(StatsHandler)
.Set....();
.Build();
consumer.Subscribe("<my-topic>");
while(true){
var logEntry = consumer.Consume();
.....
}
}
private void StatsHandler(Consumer<TKey,TValue> sender, string json)
{
Console.WriteLine(json);
}
}
is there an another way to get the consumer lag for specific (or all) groups ?
Most helpful comment
is there an another way to get the consumer lag for specific (or all) groups ?