Skip to content

Commit

Permalink
Add kafka common fields at the module level (#7767)
Browse files Browse the repository at this point in the history
Move some common fields in kafka metricsets to the module level as proposed by @gingerwizard. This will allow to correlate documents of different events.
  • Loading branch information
jsoriano authored and ruflin committed Aug 2, 2018
1 parent 235a689 commit 4fedeec
Show file tree
Hide file tree
Showing 30 changed files with 2,570 additions and 58 deletions.
3 changes: 3 additions & 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/v6.4.0...master[Check the HEAD diff]

*Metricbeat*
- Add metrics about cache size to memcached module {pull}7740[7740]
- Move common kafka fields (broker, topic and partition.id) to the module level to facilitate events correlation {pull}7767[7767]
- Add `metircs` metricset to MongoDB module. {pull}7611[7611]
- Add fields for mermory fragmentation, memory allocator stats, copy on write, master-slave status, and active defragmentation to `info` metricset of Redis module. {pull}7695[7695]

Expand All @@ -87,6 +88,8 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff]
*Metricbeat*
- Redis `info` `replication.master_offset` has been deprecated in favor of `replication.master.offset`.{pull}7695[7695]

- Move common kafka fields (broker, topic and partition.id) to the module level {pull}7767[7767].

*Packetbeat*

*Winlogbeat*
Expand Down
29 changes: 29 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,35 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------
Dependency: github.com/bsm/sarama-cluster
Revision: 7e67d87a6b3f83fe08c096fd084691bd9dca112f
License type (autodetected): MIT
./vendor/github.com/bsm/sarama-cluster/LICENSE:
--------------------------------------------------------------------
(The MIT License)

Copyright (c) 2017 Black Square Media Ltd

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------
Dependency: github.com/coreos/bbolt
Revision: af9db2027c98c61ecd8e17caa5bd265792b9b9a2
Expand Down
8 changes: 8 additions & 0 deletions dev-tools/generate_notice.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ def create_notice(filename, beat, copyright, vendor_dirs, csvfile, overrides=Non
re.sub(r"\s+", " ", """Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies."""),
re.sub(r"\s+", " ", """Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
"""),
]

BSD_LICENSE_CONTENTS = [
Expand Down
88 changes: 88 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6974,6 +6974,63 @@ Kafka module
[float]
== broker fields
Broker Consumer Group Information have been read from (Broker handling the consumer group).
*`kafka.broker.id`*::
+
--
type: long
Broker id
--
*`kafka.broker.address`*::
+
--
type: keyword
Broker advertised address
--
*`kafka.topic.name`*::
+
--
type: keyword
Topic name
--
*`kafka.topic.error.code`*::
+
--
type: long
Topic error code.
--
*`kafka.partition.id`*::
+
--
type: long
Partition id.
--
[float]
== consumergroup fields
Expand Down Expand Up @@ -7020,6 +7077,9 @@ Consumer Group ID
*`kafka.consumergroup.topic`*::
+
--
deprecated[6.5]
type: keyword
Topic name
Expand All @@ -7029,6 +7089,9 @@ Topic name
*`kafka.consumergroup.partition`*::
+
--
deprecated[6.5]
type: long
Partition ID
Expand Down Expand Up @@ -7141,6 +7204,9 @@ Partition data.
*`kafka.partition.partition.id`*::
+
--
deprecated[6.5]
type: long
Partition id.
Expand Down Expand Up @@ -7186,6 +7252,16 @@ type: boolean
Indicates if replica is included in the in-sync replicate set (ISR).
--
*`kafka.partition.partition.is_leader`*::
+
--
type: boolean
Indicates if replica is the leader
--
*`kafka.partition.partition.error.code`*::
Expand All @@ -7201,6 +7277,9 @@ Error code from fetching partition.
*`kafka.partition.topic.error.code`*::
+
--
deprecated[6.5]
type: long
topic error code.
Expand All @@ -7211,6 +7290,9 @@ topic error code.
*`kafka.partition.topic.name`*::
+
--
deprecated[6.5]
type: keyword
Topic name
Expand All @@ -7221,6 +7303,9 @@ Topic name
*`kafka.partition.broker.id`*::
+
--
deprecated[6.5]
type: long
Broker id
Expand All @@ -7231,6 +7316,9 @@ Broker id
*`kafka.partition.broker.address`*::
+
--
deprecated[6.5]
type: keyword
Broker address
Expand Down
30 changes: 30 additions & 0 deletions metricbeat/module/kafka/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,33 @@
type: group
description: >
fields:
- name: broker
type: group
description: >
Broker Consumer Group Information have been read from (Broker handling
the consumer group).
fields:
- name: id
type: long
description: >
Broker id
- name: address
type: keyword
description: >
Broker advertised address
- name: topic.name
type: keyword
description: >
Topic name
- name: topic.error.code
type: long
description: >
Topic error code.
- name: partition.id
type: long
description: >
Partition id.
60 changes: 34 additions & 26 deletions metricbeat/module/kafka/consumergroup/_meta/data.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
{
"@timestamp":"2016-05-23T08:05:34.853Z",
"type":"metricsets",
"beat":{
"hostname":"localhost",
"name":"localhost",
"version": "6.0.0-alpha1"
"@timestamp": "2017-10-12T08:05:34.853Z",
"beat": {
"hostname": "host.example.com",
"name": "host.example.com"
},
"metricset":{
"host":"localhost",
"module":"kafka",
"name":"consumergroup",
"rtt":269
},
"kafka":{
"consumergroup":{
"id": "group",
"topic": "test",
"partition": 0,
"client": {
"host": "127.0.0.1",
"id": "client0",
"member_id": "client0-d20b677a-5740-433e-a7f8-fbdab1f0f150"
},
"kafka": {
"broker": {
"address": "172.18.0.2:9092",
"id": 0
},
"consumergroup": {
"broker": {
"address": "kafka0:9092",
"address": "172.18.0.2:9092",
"id": 0
},
"client": {
"host": "172.18.0.1",
"id": "sarama",
"member_id": "sarama-714cfb8b-39e5-4128-9109-e5056c5e8f56"
},
"error": {
"code": 0
"code": 0
},
"id": "test-group",
"meta": "",
"offset": 0
"offset": -1,
"partition": 0,
"topic": "metricbeat-test"
},
"partition": {
"id": 0
},
"topic": {
"name": "metricbeat-test"
}
},
"metricset": {
"host": "kafka:9092",
"module": "kafka",
"name": "consumergroup",
"rtt": 115
}
}
}
3 changes: 3 additions & 0 deletions metricbeat/module/kafka/consumergroup/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
fields:
- name: broker
type: group
deprecated: 6.5
description: >
Broker Consumer Group Information have been read from (Broker handling
the consumer group).
Expand All @@ -26,10 +27,12 @@

- name: topic
type: keyword
deprecated: 6.5
description: Topic name

- name: partition
type: long
deprecated: 6.5
description: Partition ID

- name: offset
Expand Down
Loading

0 comments on commit 4fedeec

Please sign in to comment.