diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 09a51f4c3a6..a621206477e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -138,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* diff --git a/metricbeat/module/docker/helper.go b/metricbeat/module/docker/helper.go index 41b3edda590..1306b89e8c7 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 d415486721f..594665e87a8 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{