From c79bffdb1bb4b46489688ababab2c7783396cf00 Mon Sep 17 00:00:00 2001 From: pohzipohzi Date: Wed, 26 Sep 2018 01:55:14 +0800 Subject: [PATCH 1/4] add container image for docker metricsets --- metricbeat/module/docker/helper.go | 7 +++++-- metricbeat/module/docker/memory/memory_test.go | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/metricbeat/module/docker/helper.go b/metricbeat/module/docker/helper.go index 41b3edda590d..1306b89e8c7f 100644 --- a/metricbeat/module/docker/helper.go +++ b/metricbeat/module/docker/helper.go @@ -29,13 +29,15 @@ import ( type Container struct { ID string Name string + Image string Labels common.MapStr } func (c *Container) ToMapStr() common.MapStr { m := common.MapStr{ - "id": c.ID, - "name": c.Name, + "id": c.ID, + "name": c.Name, + "image": c.Image, } if len(c.Labels) > 0 { @@ -52,6 +54,7 @@ func NewContainer(container *types.Container, dedot bool) *Container { ID: container.ID, Name: ExtractContainerName(container.Names), Labels: DeDotLabels(container.Labels, dedot), + Image: container.Image, } } diff --git a/metricbeat/module/docker/memory/memory_test.go b/metricbeat/module/docker/memory/memory_test.go index d415486721f1..594665e87a8f 100644 --- a/metricbeat/module/docker/memory/memory_test.go +++ b/metricbeat/module/docker/memory/memory_test.go @@ -60,8 +60,9 @@ func TestMemoryService_GetMemoryStats(t *testing.T) { expectedEvent := common.MapStr{ "_module": common.MapStr{ "container": common.MapStr{ - "id": containerID, - "name": "name1", + "id": containerID, + "name": "name1", + "image": "image", "labels": common.MapStr{ "label1": "val1", "label2": common.MapStr{ From 5aab6284bd6780a088a1c0962596ca89f0892c12 Mon Sep 17 00:00:00 2001 From: pohzipohzi Date: Thu, 27 Sep 2018 00:09:20 +0800 Subject: [PATCH 2/4] add changelog --- CHANGELOG.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 84c933182d19..14269a8660ef 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -76,6 +76,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] - Fixed the RPM by designating the modules.d config files as configuration data in the RPM spec. {issue}8075[8075] - Fixed the location of the modules.d dir in Deb and RPM packages. {issue}8104[8104] - Add docker diskio stats on Windows. {issue}6815[6815] {pull}8126[8126] +- Add container image for docker metricsets. {issue}8214[8214] {pull}8438[8438] *Packetbeat* From 2d5cfb734a3d921ef0789d5daf8334b2af1b868e Mon Sep 17 00:00:00 2001 From: pohzipohzi Date: Thu, 27 Sep 2018 00:14:12 +0800 Subject: [PATCH 3/4] fix merge conflicts --- CHANGELOG.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 9388826b062e..7b9e212fc91c 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -77,9 +77,9 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] - Fixed the RPM by designating the modules.d config files as configuration data in the RPM spec. {issue}8075[8075] - Fixed the location of the modules.d dir in Deb and RPM packages. {issue}8104[8104] - Add docker diskio stats on Windows. {issue}6815[6815] {pull}8126[8126] -- Add container image for docker metricsets. {issue}8214[8214] {pull}8438[8438] - Fix incorrect type conversion of average response time in Haproxy dashboards {pull}8404[8404] - Fix dropwizard module parsing of metric names. {issue}8365[8365] {pull}6385[8385] +- Add container image for docker metricsets. {issue}8214[8214] {pull}8438[8438] *Packetbeat* From 4f62240abcdfc77a141f61c5f20f87fce0b09cd3 Mon Sep 17 00:00:00 2001 From: pohzipohzi Date: Fri, 28 Sep 2018 00:02:53 +0800 Subject: [PATCH 4/4] move changelog from bug fix to added --- CHANGELOG.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index a0c3b80011a9..a621206477e4 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -79,7 +79,6 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] - Add docker diskio stats on Windows. {issue}6815[6815] {pull}8126[8126] - Fix incorrect type conversion of average response time in Haproxy dashboards {pull}8404[8404] - Fix dropwizard module parsing of metric names. {issue}8365[8365] {pull}6385[8385] -- Add container image for docker metricsets. {issue}8214[8214] {pull}8438[8438] *Packetbeat* @@ -139,6 +138,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] - Added `ccr` metricset to Elasticsearch module. {pull}8335[8335] - Added support for query params in configuration {issue}8286[8286] {pull}8292[8292] - Support for Kafka 2.0.0 {pull}8399[8399] +- Add container image for docker metricsets. {issue}8214[8214] {pull}8438[8438] *Packetbeat*