Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 9, 2025

Proposed commit message

Add add_kubernetes_metadata processor to the OTel Beat processor.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool.

How to test this PR locally

  1. Include the processor in Elastic Agent by adding it to https://github.com/elastic/elastic-agent/blob/89e0e9a5b0ebb376773de813a1fd2c0b2f30e74a/internal/pkg/otel/components.go.
  2. Build the Elastic Agent Docker container
  3. Run the Agent in Kubernetes with an OTel config that includes the Beat processor.

Example OTel config:

    service:
      pipelines:
        logs:
          receivers:
            - filebeatreceiver
          processors:
            - beat
          exporters:
            - debug

    receivers:
      filebeatreceiver:
        filebeat:
          inputs:
            - type: filestream
              id: var-lib-docker-containers
              paths:
                - /var/lib/docker/containers/*/*.log
        # Clear the list of default processors
        processors: []
        output:
          otelconsumer:
        path.data: /tmp/1205/data
        path.logs: /tmp/1205/logs
        queue.mem:
          flush.timeout: 0

    processors:
      beat:
        processors:
          - add_kubernetes_metadata:
              add_resource_metadata:
                node:
                  enabled: false
              indexers:
                - container:
              matchers:
                - logs_path:

    exporters:
      debug:
        sending_queue:
          enabled: false
        use_internal_logger: false
        verbosity: normal
```<hr>This is an automatic backport of pull request #47942 done by [Mergify](https://mergify.com).

…47942)

* feat: add `add_kubernetes_metadata` processor to OTel Beat processor

* test: use test Logger in tests

* refactor: fix typo in function name

* test: revert to no-op logger

(cherry picked from commit 3a9d1f4)
@mergify mergify bot added the backport label Dec 9, 2025
@mergify mergify bot requested a review from a team as a code owner December 9, 2025 11:01
@mergify mergify bot added the backport label Dec 9, 2025
@mergify mergify bot requested review from VihasMakwana and orestisfl and removed request for a team December 9, 2025 11:01
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions bot added enhancement release-note:skip The PR should be ignored when processing the changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team skip-changelog labels Dec 9, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 9, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@andrzej-stencel andrzej-stencel merged commit b5fbbfa into 8.19 Dec 10, 2025
18 checks passed
@andrzej-stencel andrzej-stencel deleted the mergify/bp/8.19/pr-47942 branch December 10, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport enhancement release-note:skip The PR should be ignored when processing the changelog skip-changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants