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

Cherry-pick #22189 to 7.x: Kubernetes metadata enhancements #22536

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

ChrsMark
Copy link
Member

Cherry-pick of PR #22189 to 7.x branch. Original message:

What does this PR do?

  1. adds kubernetes.host.hostname on node metadata,
  2. attach node metadata on pod metadata by default (without add_resource_metadata required to enabled) for both events coming from autodiscovered pods but also for events enriched by add_kubernetes_metadata
  3. attach namespace metadata on pod metadata by default (without add_resource_metadata required to enabled) for both events coming from autodiscovered pods but also for events enriched by add_kubernetes_metadata
  4. Enables always add_resource_metadata section for autodiscover and add_kubernetes_metadata.

Why is it important?

This information is useful in various ways. See more on the respective issue: #20434

How to test this PR manually

  1. Use autodiscover config like:

Test with autodiscover provider

filebeat.autodiscover:
  providers:
    - type: kubernetes
      node: ${NODE_NAME}
      hints.enabled: true
      hints.default_config:
        type: container
        paths:
          - /var/log/containers/*${data.kubernetes.container.id}.log
  1. Make sure that Redis module is enabled and that kubernetes.node.hostname field is populated.

Test with add_kubernetes_metadata processor

filebeat.inputs:
- type: container
  paths:
    - /var/log/containers/*.log
  processors:
    - add_kubernetes_metadata:
        host: ${NODE_NAME}
        matchers:
        - logs_path:
            logs_path: "/var/log/containers/"
  1. Make sure that kubernetes.node.hostname field is populated as well as kubernetes.node.* and kubernetes.namespace.*.

Related issues

Screenshots

Filebeat & add_kubernetes_metadata:

Screenshot 2020-11-04 at 12 58 08

Autodiscover:

Screenshot 2020-11-04 at 13 07 30

@ChrsMark ChrsMark requested a review from a team as a code owner November 11, 2020 07:12
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 11, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 11, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 11, 2020

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 16368
Skipped 1368
Total 17736

@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 11, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Started by user Chris Mark, Replayed #1]

  • Start Time: 2020-11-12T09:33:31.225+0000

  • Duration: 70 min 0 sec

Test stats 🧪

Test Results
Failed 0
Passed 16368
Skipped 1368
Total 17736

@ChrsMark ChrsMark requested a review from jsoriano November 12, 2020 08:24
@ChrsMark ChrsMark merged commit e9df1af into elastic:7.x Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Platforms Label for the Integrations - Platforms team [zube]: In Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants