Skip to content

Conversation

@wsmoak
Copy link
Contributor

@wsmoak wsmoak commented Oct 18, 2025

Use formatted_message in the Ruby logger instrumentation so that the fully decorated log message is sent.

Fixes #1745

Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test we want here to prevent a regression ?

@wsmoak
Copy link
Contributor Author

wsmoak commented Oct 19, 2025

updated tests to assert that severity and msg are included in the body.

The body changes from/to, for example,

-"Wake up, you sleepyhead"
+"D, [2025-10-19T10:26:47.165327 #8472] DEBUG -- : Wake up, you sleepyhead
+"

There is a newline on the end now. Is that going to cause any problems? (It seems fine in Loki.)

The timestamp and process id are going to change every time. We could have a regex to assert more about the contents of the message though.

Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @wsmoak! As to your question about timestamps and process IDs, I think checking to see that the severity and body/message are both included in the body attribute should be sufficient for now for regression protection.

@kaylareopelle kaylareopelle enabled auto-merge (squash) October 28, 2025 21:27
@kaylareopelle kaylareopelle merged commit 56dd4ed into open-telemetry:main Oct 28, 2025
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider using formatted_message in Ruby Logger instrumentation

5 participants