Skip to content

Commit

Permalink
Add comment for containerID format
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKatsoulis committed Dec 21, 2021
1 parent 5873d99 commit 755b1f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions metricbeat/module/kubernetes/util/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func NewContainerMetadataEnricher(
}

if s, ok := statuses[container.Name]; ok {
// Extracting id and runtime ECS fields from ContainerID
// which is in the form of <container.runtime>://<container.id>
split := strings.Index(s.ContainerID, "://")
if split != -1 {
meta.Put("container.id", s.ContainerID[split+3:])
Expand Down

0 comments on commit 755b1f2

Please sign in to comment.