jmx_exporter
jmx_exporter copied to clipboard
Kafka Metrics showing type as "Untyped"
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?
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.
Generally, metrics will take the supported metrics type right? Is there any particular reason why these metrics are showing as "untyped"?
They are untyped because the code can't infer the metric type simply by looking at the MBean name or attribute name/value.