Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenik committed Jul 26, 2019
1 parent b19deb8 commit df9809f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ target/
.project
.settings/
.classpath
dependency-reduced-pom.xml
dependency-reduced-pom.xml
codemr/
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ Provide availability to expose:
- custom metrics (developer's responsibility)
- resource utilization metrics ([DefaultExports.initialize();](https://github.com/prometheus/client_java/blob/master/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/DefaultExports.java))

## Keep in mind
- Some of metrics are registered when client initialized
- Some of metrics are registered when client start communicate with kafka cluster
- Some of metrics are registered when client communicates with specific (f.e. authentication)
- Metrics could be removed
- Application can have several instances of kafka-clients (could be different APIs)
- `Metrics` is registered in JMX via domains depends on which API is in use
- Each domain has own set of metric type (metric's group)
- Stream API is special, because it is register 4 domains (`kafka.streams`, `kafka.consumer`, `kafka.peorducer`, `kafka.admin.client`) and have all set of metric's group from these domains.
- `NB!`: Metrics has INFO and DEBUG log level. Current implementation support only `INFO` level. (@see [Stream](###Stream))

## Metrics types
Metrics with Attributes. [Reference](https://github.com/prometheus/jmx_exporter/pull/305/commits/92a6eb106e84cd441ba9b6123132395738d6acd6)
Name of `metrics group` (prometheus context) or `metric type` (jmx context)
Expand All @@ -45,7 +56,7 @@ Name of `metrics group` (prometheus context) or `metric type` (jmx context)
* `consumer-fetch-manager-metrics` = fetch-manager metrics + per topic + per partition
* `consumer-node-metrics` = common clients metrics

### Stream:
###Stream:
Stream contains metrics from domains `kafka.producer`, `kafka.consumer`, `kafka.admin.client` and own set of metrics
such as :
* `app-info` @deprecated = common clients metrics
Expand All @@ -56,10 +67,14 @@ such as :
* `stream-record-cache-metrics` = stream record cache related metrics [DEBUG lvl]
* `stream-buffer-metrics` = stream buffer related metrics [DEBUG lvl]

`NB!`: Metrics has info and debug log level. Current implementation support only `INFO` level

### References
- [Issue 305: Add kafka client example config](https://github.com/prometheus/jmx_exporter/pull/305#issuecomment-412851484)
- [Issue 400: does the client automatically publish jmx mertices (heap size memory, thread number)?](https://github.com/prometheus/client_java/issues/400)
- [Blog post: JMX monitoring + Java custom metrics.](https://sysdig.com/blog/jmx-monitoring-custom-metrics/)
- [Kafka metrics reporter](https://github.com/apache/kafka/blob/2.0.0/clients/src/main/java/org/apache/kafka/common/metrics/MetricsReporter.java)
- [IMO - Good example how to make custom collector](https://github.com/joyent/manta-monitor/blob/master/src/main/java/com/joyent/manta/monitor/CustomPrometheusCollector.java)
- Approaches (POCs) with `org.apache.kafka.common.metrics.MetricReporter`
- [kafka-prometheus-metric-reporter](https://github.com/ripa1993/kafka-prometheus-metric-reporter)
- [kafka-client-monitoring-poc](https://github.com/sysco-middleware/kafka-client-monitoring-poc)
- [Micrometer [PR WIP]](https://github.com/micrometer-metrics/micrometer/pull/1173/files)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public enum KafkaClient {

private final String name;

private KafkaClient(String s) {
KafkaClient(String s) {
name = s;
}

Expand Down

0 comments on commit df9809f

Please sign in to comment.