Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None of the kafka.consumer.* metrics are reported #9

Open
shadyxu opened this issue Jun 26, 2015 · 9 comments
Open

None of the kafka.consumer.* metrics are reported #9

shadyxu opened this issue Jun 26, 2015 · 9 comments

Comments

@shadyxu
Copy link

shadyxu commented Jun 26, 2015

I am using Kafka 0.8.2.

Is this a bug of kafka-statsd-metric2 or mismatch of version?

@shadyxu
Copy link
Author

shadyxu commented Jun 26, 2015

Key configurations are as below:

external.kafka.statsd.metrics.exclude_regex=(.ReplicaFetcherThread.)|(kafka.cluster.Partition..)|(kafka.controller..)|(kafka.network..)|(kafka.log..)|(kafka.util..*)

external.kafka.statsd.dimension.enabled.count=true

external.kafka.statsd.dimension.enabled.meanRate=false

external.kafka.statsd.dimension.enabled.rate1m=true

external.kafka.statsd.dimension.enabled.rate5m=false
external.kafka.statsd.dimension.enabled.rate15m=false
external.kafka.statsd.dimension.enabled.min=false
external.kafka.statsd.dimension.enabled.max=false
external.kafka.statsd.dimension.enabled.mean=false
external.kafka.statsd.dimension.enabled.stddev=false
external.kafka.statsd.dimension.enabled.median=false
external.kafka.statsd.dimension.enabled.p75=false
external.kafka.statsd.dimension.enabled.p95=false
external.kafka.statsd.dimension.enabled.p98=false
external.kafka.statsd.dimension.enabled.p99=false
external.kafka.statsd.dimension.enabled.p999=false

@shadyxu
Copy link
Author

shadyxu commented Jun 26, 2015

And I store the offsets in the topic __consumer_offsets.

@alexism
Copy link
Contributor

alexism commented Jun 29, 2015

Hi @shadyxu

your issue sounds similar to #8
are you sending the metrics to a standard Statsd server?
I suspect it's because your statsd server does not support tags.

See the details in the release notes: https://github.com/airbnb/kafka-statsd-metrics2#040

@shadyxu
Copy link
Author

shadyxu commented Jun 30, 2015

Thanks @alexism

I am using the official statsd, but I found no documentation about how to set or test if it supports tags. Any idea?

@alexism
Copy link
Contributor

alexism commented Jun 30, 2015

Tags are an extension of the statsd protocol. It was introduced by Datadog: http://docs.datadoghq.com/guides/dogstatsd/#tags

If your server does not support tags, you can disable them by adding external.kafka.statsd.tag.enabled=false in your server.properties file.

When tags are disabled, the tags values are appended to the metrics names.

I'm sorry for the confusion. I created #11 to address the lack of clear documentation.

@shadyxu
Copy link
Author

shadyxu commented Jun 30, 2015

Setting external.kafka.statsd.tag.enabled=false does work. But only kafka.consumer.ReplicaFetcherThread.* metrics are reported, other consumer related metrics like kafka.consumer.ConsumerTopicMetrics.* are not.

I checked the kafka documentation, there is only kafka.consumer.ConsumerFetcherManager.* metrics. So how do you get the consumer metrics in kafka-statsd-metrics2? I am using Kafka 0.8.2, which is the latest version currently.

@jun-he
Copy link
Contributor

jun-he commented Jul 2, 2015

Hi @shadyxu,

We went through kafka code and collected all metrics. You can find ConsumerTopicMetrics from https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/metrics/KafkaMetricsGroup.scala#L114-L117.

I tested it locally using bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning --consumer.config config/consumer.properties --delete-consumer-offsets

I can see ConsumerTopicMetrics in my console using nc -lk 8125, such as kafka.consumer.ConsumerTopicMetrics.clientId.test-consumer-group.BytesPerSec.count:125|g

Did you set any filter to exclude ConsumerTopicMetrics metrics?

@shadyxu
Copy link
Author

shadyxu commented Jul 6, 2015

I have configured some exclude filters but not the ConsumerTopicMetrics metrics. Here is my filter:
external.kafka.statsd.metrics.exclude_regex=(kafka\.cluster\.Partition\..*)|(kafka\.controller\..*)|(kafka\.network\..*)|(kafka\.log\..*)|(kafka\.util\..*)

I am writing offsets to the kafka topic __consumer_offsets other than zookeeper, does this matter?

@jun-he
Copy link
Contributor

jun-he commented Jul 6, 2015

@shadyxu
Here are the steps for a quick test.

  • start your consumer
  • run jconsole and then pick consumer process
  • check if there is ConsumerTopicMetrics there
    If you cannot find any ConsumerTopicMetrics, it means kafka consumer doesn't generate this metric name. Then you may try to write offset to zookeeper and see if ConsumerTopicMetrics appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants