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

Investigate deployment and cronjob enrichement #8176

Closed
gizas opened this issue Oct 12, 2023 · 1 comment
Closed

Investigate deployment and cronjob enrichement #8176

gizas opened this issue Oct 12, 2023 · 1 comment
Labels
Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring]

Comments

@gizas
Copy link
Contributor

gizas commented Oct 12, 2023

Since v0.6.4 of elastic-agent-autodiscover is merged (see PR), this means that 2nd level ancestor of pods when they are created from deployments or cronjobs is no more created by default.

The flow is:
Deployment -> Replicaset > pod
Cronjob -> Job > pod

So although job and replicaset name is enriched in pods, the deployment and cronjob no more.

@gizas gizas added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring] label Oct 12, 2023
@gizas
Copy link
Contributor Author

gizas commented Oct 16, 2023

Ingest pipeline that tested 👍

Login to Kibana Console:

POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "processors": [
      {"gsub": {
          "field": "kubernetes.replicaset.name",
          "pattern": "(?:.(?!-))+$",
          "replacement": "",
          "target_field": "kubernetes.deployment",
          "ignore_failure": true,
          "ignore_missing": true
      }
      } 
      ]
  }, 
  "docs": [
    {
    "_id": "-NYBC4kBqzI6pGDGasKv",
    "_index": ".ds-metrics-kuberntes.state_pod-2023.06.29-000013",
      "_source": {
    "kubernetes": {
        "replicaset": { "name": "pasole-3456-1234-567890789"},
        "node": {
            "uid": "57ccd748-c877-4be9-9b0e-568e9f205025",
            "hostname": "kind-control-plane",
            "name": "kind-control-plane",
            "labels": {
                "node_kubernetes_io/exclude-from-external-load-balancers": "",
                "node-role_kubernetes_io/master": "",
                "kubernetes_io/hostname": "kind-control-plane",
                "node-role_kubernetes_io/control-plane": "",
                "beta_kubernetes_io/os": "linux",
                "kubernetes_io/arch": "amd64",
                "kubernetes_io/os": "linux",
                "beta_kubernetes_io/arch": "amd64"
            }}}
  }
      
    }
    ]
}

Output:

{
  "docs": [
    {
      "doc": {
        "_index": ".ds-metrics-kuberntes.state_pod-2023.06.29-000013",
        "_id": "-NYBC4kBqzI6pGDGasKv",
        "_version": "-3",
        "_source": {
          "kubernetes": {
            "node": {
              "uid": "57ccd748-c877-4be9-9b0e-568e9f205025",
              "hostname": "kind-control-plane",
              "name": "kind-control-plane",
            ....
            },
            "replicaset": {
              "name": "pasole-3456-1234-567890789"
            },
            "deployment": "pasole-3456-1234"
          }
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring]
Projects
None yet
Development

No branches or pull requests

2 participants