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

add container image for docker metricsets #8438

Merged
merged 6 commits into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -79,6 +79,7 @@ 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]
pohzipohzi marked this conversation as resolved.
Show resolved Hide resolved

*Packetbeat*

Expand Down
7 changes: 5 additions & 2 deletions metricbeat/module/docker/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
}
}

Expand Down
5 changes: 3 additions & 2 deletions metricbeat/module/docker/memory/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down