[9.4] (backport #15491) Write OTel collector logs to its own log file#15765
Open
mergify[bot] wants to merge 1 commit into
Open
[9.4] (backport #15491) Write OTel collector logs to its own log file#15765mergify[bot] wants to merge 1 commit into
mergify[bot] wants to merge 1 commit into
Conversation
(cherry picked from commit 61463e6) # Conflicts: # .golangci.yml # internal/pkg/otel/manager/manager.go # internal/pkg/otel/manager/manager_test.go # testing/integration/ess/event_logging_test.go # testing/integration/ess/logging_file_test.go
mergify
Bot
requested review from
swiatekm and
ycombinator
and removed request for
a team
July 23, 2026 07:41
Contributor
Author
|
Cherry-pick of 61463e6 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The OTel runtime now writes to its own log file instead of sharing the Elastic Agent's own log file.
Before this change the collector wrote into the same file as the agent itself:
logs/ ├── elastic-agent-20260713.ndjson └── events/ └── elastic-agent-event-log-20260713.ndjsonExample of the new log layout, running under the
otelruntime:logs/ ├── elastic-agent-20260713.ndjson ├── elastic-otel-collector-20260713.ndjson └── events/ ├── elastic-agent-event-log-20260713.ndjson # only created if process runtime is also used └── elastic-otel-collector-event-log-20260713.ndjsonOTel collector now gets its own events log file. This is a consequence of how
elastic-agent-libstyped loggers work, each logger instance creates its own event output file. Sharing a single events file across components would require a larger refactor of the logging framework.Why is it important?
Before this change, the OTel collector wrote into the same log file as the Agent itself. This made it hard to find the logs that belong to a specific input or component and mixed event data together with regular operational logs.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog toolDisruptive User Impact
Anyone who wants to retrieve OTel collector logs should check the new file name under the
logsandeventsdirectory. If they use theelastic-agent logscommand nothing changes.How to test this PR locally
This can be easily tested with the following integration test:
Related issues
This is an automatic backport of pull request #15491 done by [Mergify](https://mergify.com).