jmx_exporter icon indicating copy to clipboard operation
jmx_exporter copied to clipboard

Kafka Metrics showing type as "Untyped"

Open Dharani0618 opened this issue 1 year ago • 3 comments
trafficstars

Most of the Kafka metrics type is showing as 'untyped' as below.

# HELP kafka_server_ZooKeeperClientMetrics_Min Attribute exposed for management kafka.server:name=ZooKeeperRequestLatencyMs,type=ZooKeeperClientMetrics,attribute=Min
# TYPE kafka_server_ZooKeeperClientMetrics_Min untyped
# HELP java_lang_CodeHeap_non_profiled_nmethods_UsageThreshold java.lang:name=CodeHeap 'non-profiled nmethods',type=MemoryPool,attribute=UsageThreshold
# TYPE java_lang_CodeHeap_non_profiled_nmethods_UsageThreshold untyped
# HELP kafka_server_socket_server_metrics_successful_reauthentication_rate The number of successful re-authentication of connections per second kafka.server:name=null,type=socket-server-metrics,attribute=successful-reauthentication-rate
# TYPE kafka_server_socket_server_metrics_successful_reauthentication_rate untyped

The file metrics.txt consists of all metrics which has type as "untyped"

But the supported Prometheus metric types are Counter | Gauge | Histogram | Summary as per https://prometheus.io/docs/concepts/metric_types/ Is it possible to change type of metrics from "untyped" to the Prometheus supported types?

Dharani0618 avatar Jun 07 '24 13:06 Dharani0618

Sure, that's perfectly possible, but you need to configure which type you want. If you look at the examples in the example_configs/ folder, you will see many examples with type: COUNTER or type: GAUGE.

See for example https://github.com/prometheus/jmx_exporter/blob/main/example_configs/kafka-2_0_0.yml.

fstab avatar Jun 07 '24 15:06 fstab

Generally, metrics will take the supported metrics type right? Is there any particular reason why these metrics are showing as "untyped"?

Dharani0618 avatar Jun 12 '24 07:06 Dharani0618

They are untyped because the code can't infer the metric type simply by looking at the MBean name or attribute name/value.

dhoard avatar Jun 12 '24 12:06 dhoard