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 owner object info to Kubernetes metadata #7231

Merged
merged 2 commits into from
Jun 1, 2018

Conversation

exekias
Copy link
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
Member

ruflin commented Jun 1, 2018

@exekias Should we add this field to ECS?

@exekias
Copy link
Contributor Author

exekias commented Jun 1, 2018

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

@@ -16,11 +16,6 @@ type Config struct {
SyncPeriod time.Duration `config:"sync_period"`
CleanupTimeout time.Duration `config:"cleanup_timeout"`

IncludeLabels []string `config:"include_labels"`

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
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