-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Ruby Logger instrumentation #983
base: main
Are you sure you want to change the base?
feat: Ruby Logger instrumentation #983
Conversation
…-ruby-contrib into logger-instrumentation
…elle/opentelemetry-ruby-contrib into logger-instrumentation
Appraisal can't install gems from a git source. Since the appraisal is only necessary for active_support_logger, disable those tests while working on other features.
chore: Allow logger patch tests to run
…-ruby-contrib into logger-instrumentation
…elle/opentelemetry-ruby-contrib into logger-instrumentation
feat: map logger level to OTel level
* Add references to released logs gems * Test Rails 7.0 - 8.0 * Rubocop * Set gem version
…ntelemetry-ruby-contrib into logger-instrumentation
severity_text: severity, | ||
severity_number: severity_number(severity), | ||
timestamp: datetime, | ||
body: msg, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Relic uses formatted_message
here. This includes both the progname and the message in the body, whereas msg
does not include the progname. Which seems more appropriate?
Test the outcome rather than the presence of variables
I'm still trying to figure out why one of the tests is failing on the CI, but passes locally. However, everything except the ActiveSupportLogger code should be ready for review. Please take a look and I'll push the update as soon as I can! |
I am very interested in getting this to work with Opentelemetry. Any way I could help with this work? |
…ntelemetry-ruby-contrib into logger-instrumentation
* move dev dependencies to Gemfile * require 'logger' in test helper * set min version to Ruby 3.1
Hi @tomash! Thanks for reaching out. It's great to hear there's interest in this PR. I'd love your help! The features for the bridge should be complete. I just updated the branch to align with some of the changes in Specifically, I could use help with:
|
For now I have this monstrosity in Gemfile:
And I can confirm it works well for our app (the logs appear in Honeycomb just as events). The only problem is that Rails logs are noisy by default and it makes "top messages" unusable (top message being "rendered profiles/_carousel.html.erb"), so I've also dropped in Lograge to produce fewer logs. I haven't seen open-telemetry/opentelemetry-ruby#1789 , will evaluate and compare! I do like how lightweight and easy to read it is. |
Description
This an OpenTelemetry logs bridge for Ruby's standard Logger library.
It also includes patches to
ActiveSupport::Logger.broadcast
and theActiveSupport::BroadcastLogger
to emit only one log record for a broadcast.@khushijain21 is a co-author of this PR and contributed functionality as part of her LFX mentorship with OpenTelemetry in 2024.
Closes #668