Skip to content

[9.5](backport #51679) otel(processors): implement PdataProcessor for add_docker_metadata#51916

Merged
mauri870 merged 2 commits into
9.5from
mergify/bp/9.5/pr-51679
Jul 14, 2026
Merged

[9.5](backport #51679) otel(processors): implement PdataProcessor for add_docker_metadata#51916
mauri870 merged 2 commits into
9.5from
mergify/bp/9.5/pr-51679

Conversation

@mergify

@mergify mergify Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

Adds RunPdata, which enriches a pcommon.Map directly with Docker container metadata. Introduces resolveCIDFromPdata, mirroring Run's three-path CID resolution strategy (log.file.path via sourceProcessor, PID-based cgroup lookup, user-defined match fields) without converting to/from mapstr.M. Parity coverage in TestMatchContainer verifies Run and RunPdata produce identical output.

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

go test -count=1 -v ./libbeat/processors/add_docker_metadata/...

Related issues


This is an automatic backport of pull request #51679 done by [Mergify](https://mergify.com).

…51679)

Adds RunPdata, which enriches a pcommon.Map directly with Docker
container metadata. Introduces resolveCIDFromPdata, mirroring Run's
three-path CID resolution strategy (log.file.path via sourceProcessor,
PID-based cgroup lookup, user-defined match fields) without converting
to/from mapstr.M. Parity coverage in TestMatchContainer verifies Run
and RunPdata produce identical output.

* metricbeat: fix module.NewWrapper call in runner_test.go

Upstream commit c2c559c passed a bare *logp.Logger as the third
argument to module.NewWrapper, whose signature expects *beat.Info,
breaking build/vet. Wrap the logger in &beat.Info{...} to match the
API and the other calls in this file.

* reuse code between Run/RunPdata

* more coverage for Run == RunPdata for negative cases

* linter fix

(cherry picked from commit 53993f3)
@mergify mergify Bot requested a review from a team as a code owner July 14, 2026 11:15
@mergify mergify Bot added the backport label Jul 14, 2026
@mergify mergify Bot requested review from AndersonQ and belimawr and removed request for a team July 14, 2026 11:15
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 14, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@mauri870 mauri870 enabled auto-merge (squash) July 14, 2026 11:30
@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

The only failure is an unrelated Winlogbeat Windows unit test: winlogbeat/eventlog/TestWindowsEventLogAPI fails while opening the test event log with Access is denied. The PR changes only libbeat/processors/add_docker_metadata, so this does not point to a regression in the PR. Please retry after checking the Windows 2025 agent event-log subscription and privilege configuration.

Remediation

  • Retry the failed Winlogbeat: Win 2025 Unit Tests job; if it reproduces, run the test under the same agent identity with permission to subscribe to the custom WinlogbeatTestGo channel and inspect the runner elevation/service-account policy.
  • Validate with go test ./winlogbeat/eventlog on the Windows 2025 image after restoring event-log access.
Investigation details

Root Cause

TestWindowsEventLogAPI calls createLog at winlogbeat/eventlog/wineventlog_test.go:167. createLog registers the custom provider and then opens it at winlogbeat/eventlog/wineventlog_test.go:336-341; the failure is reported at line 341 as Access is denied. The underlying reader subscribes to the channel through the Windows Event Log API in winlogbeat/eventlog/wineventlog.go:334-355. The failing test and Winlogbeat event-log implementation are outside this PR's two changed files.

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/49370
  • Job/step: Winlogbeat: Win 2025 Unit Tests / mage build unitTest
  • Key log excerpt: === FAIL: winlogbeat/eventlog TestWindowsEventLogAPI (0.08s), followed by wineventlog_test.go:341: Access is denied.

Verification


What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@mauri870

Copy link
Copy Markdown
Member

/test

@mauri870 mauri870 merged commit a67a106 into 9.5 Jul 14, 2026
205 of 207 checks passed
@mauri870 mauri870 deleted the mergify/bp/9.5/pr-51679 branch July 14, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant