-
Notifications
You must be signed in to change notification settings - Fork 170
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: 🚧 WIP: Logger instrumentation #983
Draft
kaylareopelle
wants to merge
58
commits into
open-telemetry:main
Choose a base branch
from
kaylareopelle:logger-instrumentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: 🚧 WIP: Logger instrumentation #983
kaylareopelle
wants to merge
58
commits into
open-telemetry:main
from
kaylareopelle:logger-instrumentation
Conversation
This file contains 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
…-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
instrumentation/logger/lib/opentelemetry/instrumentation/logger/instrumentation.rb
Outdated
Show resolved
Hide resolved
feat: methods to set custom logger name and version
chore: Add tests for name and version config
feat: add check for logs sdk
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
kaylareopelle
added
keep
Ensures stale-bot keeps this issue/PR open
and removed
stale
Marks an issue/PR stale
labels
Jun 24, 2024
…ntelemetry-ruby-contrib into logger-instrumentation
Rails 7.1+ uses ActiveSupport::BroadcastLogger. This needs to protect against emitting duplicate logs in a different way than ActiveSupport::Logger.broadcast. Emits the log record for the first logger in the broadcast, skip the others. Reset everything at the end of the method call.
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.
Description
This is a work-in-progress implementation of an OpenTelemetry logs bridge for Ruby's built-in Logger library.
It also includes patches to ActiveSupport::Logger.broadcast and the ActiveSupport::BroadcastLogger to emit only one log record for a broadcast.
It relies on a WIP Logs SDK and OTLP exporter implementation. If you'd like to test out this experimental code, follow the instructions on this gist, or clone this demo repo.
The SDK and OTLP exporter code is being reviewed in small chunks on the open-telemetry/opentelemetry-ruby repository. Follow the progress on the Logs project board.
Once the SDK/exporter code is merged into the main repo, this PR can be taken out of draft mode.
@khushijain21 is a co-author of this PR and contributed functionality as part of her LFX mentorship with OpenTelemetry in 2024.
TODOs:
Verify OpenTelemetry logs aren't emitted as LogRecords (or should they be?)Seems they canCloses #668