Skip to content

heartbeat: log monitor runs through the monitor's own logger - #54955

Open
mcapell wants to merge 2 commits into
elastic:mainfrom
mcapell:chore/heartbeat-run-log-per-monitor-logger
Open

mcapell wants to merge 2 commits into
elastic:mainfrom
mcapell:chore/heartbeat-run-log-per-monitor-logger

Conversation

@mcapell

@mcapell mcapell commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Proposed commit message

LogRun cached one process-wide logger taken from logp.L() the first time
any monitor finished. In receiver mode several receivers share a process
and logp.L() is overwritten on every receiver creation, so every run log
went through whichever receiver was configured last.

Pass the summarizer's logger (the beat's/receiver's logger) to LogRun and
remove the package-level cache and SetLogger.

Co-Authored-By: Claude Sonnet 5.5

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.

Disruptive User Impact

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

LogRun cached one process-wide logger taken from logp.L() the first time
any monitor finished. In receiver mode several receivers share a process
and logp.L() is overwritten on every receiver creation, so every run log
went through whichever receiver was configured last.

Pass the summarizer's logger (the beat's/receiver's logger) to LogRun and
remove the package-level cache and SetLogger.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mcapell mcapell added Team:obs-signals-logs-team backport-9.6 Automated backport to the 9.6 branch labels Nov 26, 2026
@botelastic botelastic Bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Nov 26, 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.

Fixes the modernize embedlit lint finding: the logger is a field promoted
from the embedded TelemetrySettings and can be set in the literal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mcapell
mcapell marked this pull request as ready for review November 26, 2026 18:08
@mcapell
mcapell requested a review from a team as a code owner November 26, 2026 18:08
@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.6 Automated backport to the 9.6 branch Team:obs-signals-logs-team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant