Skip to content

Add owner object info to Kubernetes metadata#7231

Merged
ruflin merged 2 commits intoelastic:masterfrom
exekias:kubernetes-related-object
Jun 1, 2018
Merged

Add owner object info to Kubernetes metadata#7231
ruflin merged 2 commits intoelastic:masterfrom
exekias:kubernetes-related-object

Conversation

@exekias
Copy link
Copy Markdown
Contributor

@exekias exekias commented May 31, 2018

This change adds object name for the Pod owner (if any) when enriching
with kubernetes metadata.

This information is really useful when mapping running containers to
their creator workload.

Resulting metadata will now include the name of the Deployment, ReplicaSet or StatefulSet who created the Pod (if any), ie:

{
  "kubernetes":{
    "container":{
      "name":"kube-state-metrics"
    },
    "labels":{
      "k8s-app":"kube-state-metrics",
      "pod-template-hash":"2035844717"
    },
    "namespace":"kube-system",
    "node":{
      "name":"minikube"
    },
    "pod":{
      "name":"kube-state-metrics-6479d88c5c-5b6cl"
    },
    "replicaset":{
      "name":"kube-state-metrics-6479d88c5c"
    }
  }
}

@exekias exekias changed the title Kubernetes related object Add owner object info to Kubernetes metadata May 31, 2018
This change adds object name for the Pod owner (if any) when enriching
with kubernetes metadata.

This information is really useful when mapping running containers to
their creator workload.
@exekias exekias force-pushed the kubernetes-related-object branch from f9dbbdf to f8e28e7 Compare May 31, 2018 23:15
@ruflin ruflin merged commit 3cf4b36 into elastic:master Jun 1, 2018
@ruflin
Copy link
Copy Markdown
Contributor

ruflin commented Jun 1, 2018

@exekias Should we add this field to ECS?

@exekias
Copy link
Copy Markdown
Contributor Author

exekias commented Jun 1, 2018

maybe, let's figure out if it makes sense once released

SyncPeriod time.Duration `config:"sync_period"`
CleanupTimeout time.Duration `config:"cleanup_timeout"`

IncludeLabels []string `config:"include_labels"`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove config for labels and annotations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change only moved them around in the code (while didn't change how they worked): https://github.com/elastic/beats/pull/7231/files#diff-f7068996b1041934b4fa71b630725b55R20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants