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 module #2969

Merged
merged 1 commit into from
Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ https://github.com/elastic/beats/compare/v5.0.0...master[Check the HEAD diff]
- Add system core metricset for Windows. {pull}2883[2883]
- Add a sample Redis Kibana dashboard. {pull}2916[2916]
- Add support for MongoDB 3.4 and WiredTiger metrics. {pull}2999[2999]
- Add kafkka module with partition metricset. {pull}2969[2969]

*Packetbeat*
- Define `client_geoip.location` as geo_point in the mappings to be used by the GeoIP processor in the Ingest Node pipeline.
Expand Down
8 changes: 8 additions & 0 deletions metricbeat/_meta/beat.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ metricbeat.modules:
#period: 10s
#hosts: ["tcp://127.0.0.1:14567"]

#-------------------------------- kafka Module -------------------------------
#- module: kafka
#metricsets: ["partition"]
#enabled: true
#period: 10s
#hosts: ["localhost:9092"]


#------------------------------- MongoDB Module ------------------------------
#- module: mongodb
#metricsets: ["status"]
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/_meta/kibana/index-pattern/metricbeat.json

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
- apache
- filebeat
- mongodb
- kafka
- mysql
- nginx
- postgresql
Expand All @@ -17,6 +18,8 @@ services:
- APACHE_PORT=80
- FILEBEAT_HOST=filebeat
- FILEBEAT_PORT=6060
- KAFKA_HOST=kafka
- KAFKA_PORT=9092
- NGINX_HOST=nginx
- NGINX_PORT=80
- REDIS_HOST=redis
Expand Down Expand Up @@ -54,6 +57,14 @@ services:
filebeat:
build: ${PWD}/module/beats/filebeat/_meta

kafka:
image: spotify/kafka
expose:
- 9092
- 2181
environment:
- ADVERTISED_HOST=kafka

mongodb:
image: mongo:3.4

Expand All @@ -77,3 +88,4 @@ services:
zookeeper:
image: jplock/zookeeper:3.4.8


3 changes: 2 additions & 1 deletion metricbeat/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ waitFor() {
# Main
waitFor ${APACHE_HOST} ${APACHE_PORT} Apache
waitFor ${FILEBEAT_HOST} ${FILEBEAT_PORT} Filebeat
waitFor ${HAPROXY_HOST} ${HAPROXY_PORT} HAProxy
waitFor ${KAFKA_HOST} ${KAFKA_PORT} Kafka
waitFor ${MYSQL_HOST} ${MYSQL_PORT} MySQL
waitFor ${NGINX_HOST} ${NGINX_PORT} Nginx
waitFor ${POSTGRESQL_HOST} ${POSTGRESQL_PORT} Postgresql
waitFor ${REDIS_HOST} ${REDIS_PORT} Redis
waitFor ${ZOOKEEPER_HOST} ${ZOOKEEPER_PORT} Zookeeper
waitFor ${HAPROXY_HOST} ${HAPROXY_PORT} HAProxy
exec "$@"
76 changes: 76 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ grouped in the following categories:
* <<exported-fields-common>>
* <<exported-fields-docker>>
* <<exported-fields-haproxy>>
* <<exported-fields-kafka>>
* <<exported-fields-mongodb>>
* <<exported-fields-mysql>>
* <<exported-fields-nginx>>
Expand Down Expand Up @@ -2147,6 +2148,81 @@ type: integer
the average total session time in ms over the 1024 last requests


[[exported-fields-kafka]]
== kafka Fields

kafka Module



[float]
== kafka Fields




[float]
== partition Fields

partition



[float]
== offset Fields

Available offsets of the given partition.



[float]
=== kafka.partition.offset.newest

type: long

Newest offset of the partition.


[float]
=== kafka.partition.offset.oldest

type: long

Oldest offset of the partition.


[float]
=== kafka.partition.partition

type: long

Partition id.


[float]
=== kafka.partition.topic

type: keyword

Topic name


[float]
=== kafka.partition.broker.id

type: long

Broker id


[float]
=== kafka.partition.broker.address

type: keyword

Broker address


[[exported-fields-mongodb]]
== MongoDB Fields

Expand Down
37 changes: 37 additions & 0 deletions metricbeat/docs/modules/kafka.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-module-kafka]]
== kafka Module

This is the kafka Module.



[float]
=== Example Configuration

The kafka module supports the standard configuration options that are described
in <<configuration-metricbeat>>. Here is an example configuration:

[source,yaml]
----
metricbeat.modules:
#- module: kafka
#metricsets: ["partition"]
#enabled: true
#period: 10s
#hosts: ["localhost:9092"]

----

[float]
=== Metricsets

The following metricsets are available:

* <<metricbeat-metricset-kafka-partition,partition>>

include::kafka/partition.asciidoc[]

19 changes: 19 additions & 0 deletions metricbeat/docs/modules/kafka/partition.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-kafka-partition]]
include::../../../module/kafka/partition/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-kafka,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/kafka/partition/_meta/data.json[]
----
2 changes: 2 additions & 0 deletions metricbeat/include/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
_ "github.com/elastic/beats/metricbeat/module/haproxy"
_ "github.com/elastic/beats/metricbeat/module/haproxy/info"
_ "github.com/elastic/beats/metricbeat/module/haproxy/stat"
_ "github.com/elastic/beats/metricbeat/module/kafka"
_ "github.com/elastic/beats/metricbeat/module/kafka/partition"
_ "github.com/elastic/beats/metricbeat/module/mongodb"
_ "github.com/elastic/beats/metricbeat/module/mongodb/status"
_ "github.com/elastic/beats/metricbeat/module/mysql"
Expand Down
8 changes: 8 additions & 0 deletions metricbeat/metricbeat.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ metricbeat.modules:
#period: 10s
#hosts: ["tcp://127.0.0.1:14567"]

#-------------------------------- kafka Module -------------------------------
#- module: kafka
#metricsets: ["partition"]
#enabled: true
#period: 10s
#hosts: ["localhost:9092"]


#------------------------------- MongoDB Module ------------------------------
#- module: mongodb
#metricsets: ["status"]
Expand Down
38 changes: 38 additions & 0 deletions metricbeat/metricbeat.template-es2x.json
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,44 @@
}
}
},
"kafka": {
"properties": {
"partition": {
"properties": {
"broker": {
"properties": {
"address": {
"ignore_above": 1024,
"index": "not_analyzed",
"type": "string"
},
"id": {
"type": "long"
}
}
},
"offset": {
"properties": {
"newest": {
"type": "long"
},
"oldest": {
"type": "long"
}
}
},
"partition": {
"type": "long"
},
"topic": {
"ignore_above": 1024,
"index": "not_analyzed",
"type": "string"
}
}
}
}
},
"meta": {
"properties": {
"cloud": {
Expand Down
36 changes: 36 additions & 0 deletions metricbeat/metricbeat.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,42 @@
}
}
},
"kafka": {
"properties": {
"partition": {
"properties": {
"broker": {
"properties": {
"address": {
"ignore_above": 1024,
"type": "keyword"
},
"id": {
"type": "long"
}
}
},
"offset": {
"properties": {
"newest": {
"type": "long"
},
"oldest": {
"type": "long"
}
}
},
"partition": {
"type": "long"
},
"topic": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
},
"meta": {
"properties": {
"cloud": {
Expand Down
6 changes: 6 additions & 0 deletions metricbeat/module/kafka/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#- module: kafka
#metricsets: ["partition"]
#enabled: true
#period: 10s
#hosts: ["localhost:9092"]

4 changes: 4 additions & 0 deletions metricbeat/module/kafka/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
== kafka Module

This is the kafka Module.

10 changes: 10 additions & 0 deletions metricbeat/module/kafka/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- key: kafka
title: "kafka"
description: >
kafka Module
short_config: false
fields:
- name: kafka
type: group
description: >
fields:
20 changes: 20 additions & 0 deletions metricbeat/module/kafka/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Package kafka is a Metricbeat module that contains MetricSets.

Kafka is organised as following

- Topic
- Partition
- Producer
- Consumer
- Consumer Groups
- Broker

Notes
- Topics has a list of partitions
- Each partition has an offset
- Topic can be across brokers
- Each broker has a list of paritions

*/
package kafka
Loading