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

Kafka Metrics showing type as "Untyped" #971

Closed
Dharani0618 opened this issue Jun 7, 2024 · 3 comments
Closed

Kafka Metrics showing type as "Untyped" #971

Dharani0618 opened this issue Jun 7, 2024 · 3 comments

Comments

@Dharani0618
Copy link

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?

@fstab
Copy link
Member

fstab commented Jun 7, 2024

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.

@Dharani0618
Copy link
Author

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

@dhoard
Copy link
Collaborator

dhoard commented Jun 12, 2024

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

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

No branches or pull requests

3 participants