View the latest documentation 5.5
A common instruction for Services’ metrics. All core services (Kafka, Schema Registry, Kafka Connect, Zookeeper) use the same set of properties for services’ monitoring.
The same port used for all brokers/workers/nodes. No SSL, no authentication.
- metricsPort: 9585 - metricsType: JMX - metricsSsl: false
- metricsPort: 9585 - metricsType: JMX - metricsSsl: true
- metricsPort: 9585 - metricsType: JMX - metricsSsl: false - metricsUsername: user - metricsPassword: pass
kafka: tags: [] templateName: Kafka configurationObject: kafkaBootstrapServers: - PLAINTEXT://my-kafka-host-0:9092 protocol: PLAINTEXT metricsPort: 9581 metricsType: JMX metricsSsl: false metricsUsername: user metricsPassword: pass
Such a configuration means that Lenses will try to connect using JMX with every pair of kafkaBootstrapServers.host:metricsPort, so following the example: my-kafka-host-0:9581.
kafkaBootstrapServers.host:metricsPort
my-kafka-host-0:9581
For jolokia Lenses supports two types of requests: GET (JOLOKIAG) and POST (JOLOKIAP).
JOLOKIAG
JOLOKIAP
- metricsPort: 9585 - metricsType: JOLOKIAG - metricsSsl: false - metricsHttpSuffix: /jolokia/
- metricsPort: 9585 - metricsType: JOLOKIAG - metricsSsl: true - metricsHttpSuffix: /jolokia/
- metricsPort: 9585 - metricsType: JOLOKIAG - metricsSsl: false - metricsUsername: user - metricsPassword: pass - metricsHttpSuffix: /jolokia/
JOLOKIA monitoring works on the top of HTTP protocol. To fetch metrics Lenses has to perform either GET or POST request. There is a way of configuring http request timeout using httpRequestTimeout property (ms value). Its default value is 20 seconds.
httpRequestTimeout
- metricsPort: 9585 - metricsType: JOLOKIAG - metricsSsl: false - httpRequestTimeout: 30000 - metricsHttpSuffix: /jolokia/
Default suffix for Jolokia endpoints is /jolokia/, so that should be provided value. Sometimes that suffix can be different, so there is a way of customizing it by using metricsHttpSuffix field.
/jolokia/
metricsHttpSuffix
- metricsPort: 9585 - metricsType: JOLOKIAG - metricsSsl: false - metricsHttpSuffix: /custom/
kafka: tags: [] templateName: Kafka configurationObject: kafkaBootstrapServers: - PLAINTEXT://my-kafka-host-0:9092 protocol: PLAINTEXT metricsPort: 9581 metricsType: JOLOKIAP metricsSsl: false metricsUsername: user metricsPassword: pass httpRequestTimeout: 30000 metricsHttpSuffix: /custom/
Such a configuration means that Lenses will try to connect using JOLOKIA for each broker following this pattern: protocol://kafkaBootstrapServers.host:metricsPort/metricsHttpSuffix/. Protocol part is http or https - it depends on metricsSsl value. Taking the values from the example, Lenses will try to fetch metrics using http://my-kafka-host-0:9581/custom/.
protocol://kafkaBootstrapServers.host:metricsPort/metricsHttpSuffix/
http
https
metricsSsl
http://my-kafka-host-0:9581/custom/
AWS has predefined metrics configuration. Lenses hits Prometheus using port 11001 for each broker. There is an option of customizing AWS metrics connection in Lenses by using metricsUsername, metricsPassword, httpRequestTimeout, metricsHttpSuffix, metricsCustomUrlMappings, metricsSsl properties, but most likely no one will need to do that - AWS has its own standard and most probably it won’t change. Customization can be achieved only by API or CLI - UI does not support it.
11001
metricsUsername
metricsPassword
metricsCustomUrlMappings
There is also a way to configure custom mapping for each broker (Kafka) / node (Schema Registry, Zookeeper) / worker (Kafka Connect).
kafka: tags: [] templateName: Kafka configurationObject: kafkaBootstrapServers: - PLAINTEXT://my-kafka-host-0:9092 - PLAINTEXT://my-kafka-host-1:9092 protocol: PLAINTEXT metricsPort: 9581 metricsType: JMX metricsSsl: false metricsCustomUrlMappings: "my-kafka-host-0:9092": my-kafka-host-0:9582
Such a configuration means that Lenses will try to connect using JMX for:
metricsPort
Note: For JOLOKIA each entry value in metricsCustomUrlMappings must contain protocol.
Note: Kafka connection requires Bootstrap Servers, which means that to establish connection and discover all the brokers in cluster there is no need to provide whole list of brokers in kafkaBootstrapServers. In such a case Lenses will discover all the brokers by itself and will try to fetch metrics using metricsPort, metricsCustomUrlMappings and other properties (if specified).
kafkaBootstrapServers
On this page