forked from open-telemetry/opentelemetry-ruby-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
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: Ruby Logger instrumentation #1
Draft
kaylareopelle
wants to merge
79
commits into
main
Choose a base branch
from
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.
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
kaylareopelle
changed the title
WIP Ruby Logger instrumentation
WIP: Ruby Logger instrumentation
Oct 16, 2023
kaylareopelle
commented
Mar 29, 2024
instrumentation/logger/Gemfile
Outdated
Comment on lines
17
to
20
gem 'opentelemetry-api', path: '/Users/kreopelle/dev/opentelemetry-ruby/api' | ||
gem 'opentelemetry-logs-api', path: '/Users/kreopelle/dev/opentelemetry-ruby/logs_api' | ||
gem 'opentelemetry-logs-sdk', path: '/Users/kreopelle/dev/opentelemetry-ruby/logs_sdk' | ||
gem 'opentelemetry-sdk', path: '/Users/kreopelle/dev/opentelemetry-ruby/sdk' |
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.
Whoops, didn't mean to commit my local paths. This will install things with the latest SDK branch, but Appraisal is having trouble installing gems via git, so this might not be the best solution:
Suggested change
gem 'opentelemetry-api', path: '/Users/kreopelle/dev/opentelemetry-ruby/api' | |
gem 'opentelemetry-logs-api', path: '/Users/kreopelle/dev/opentelemetry-ruby/logs_api' | |
gem 'opentelemetry-logs-sdk', path: '/Users/kreopelle/dev/opentelemetry-ruby/logs_sdk' | |
gem 'opentelemetry-sdk', path: '/Users/kreopelle/dev/opentelemetry-ruby/sdk' | |
gem 'opentelemetry-api', git: 'https://github.com/kaylareopelle/opentelemetry-ruby', branch: 'log-record-processor3', glob: 'api/*.gemspec' | |
gem 'opentelemetry-logs-api', git: 'https://github.com/kaylareopelle/opentelemetry-ruby', branch: 'log-record-processor3', glob: 'logs_api/*.gemspec' | |
gem 'opentelemetry-logs-sdk', git: 'https://github.com/kaylareopelle/opentelemetry-ruby', branch: 'log-record-processor3', glob: 'logs_sdk/*.gemspec' | |
gem 'opentelemetry-sdk', git: 'https://github.com/kaylareopelle/opentelemetry-ruby', branch: 'log-record-processor3', glob: 'sdk/*.gemspec' |
…-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.
kaylareopelle
changed the title
WIP: Ruby Logger instrumentation
feat: WIP: Ruby Logger instrumentation
Mar 30, 2024
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
…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.
) * fix: get correct table name if table name is quoted * Remove double test * Add new line to sql_table_name.json * Stop accepting table name in single quotes --------- Co-authored-by: Kayla Reopelle <[email protected]> Co-authored-by: Ariel Valentin <[email protected]>
Co-authored-by: Ariel Valentin <[email protected]>
…elemetry#1243) Bumps [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action) from 17 to 18. - [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases) - [Commits](DavidAnson/markdownlint-cli2-action@v17...v18) --- updated-dependencies: - dependency-name: DavidAnson/markdownlint-cli2-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ariel Valentin <[email protected]>
…ry#1222) * Main Created a readable constant in 8 files to freeze ranges 100..399 . Relate to open-telemetry#1172 * refactor: Create a readable constant in 8 files to freeze ranges 100..399 . Reviewed-by: kaylareopelle Refs: open-telemetry#1172 * refactor: Fix rubocop ruby linter failures Reviewed-by: kaylareopelle Refs: open-telemetry#1172 * refactor: Fix rubocop ruby linter failures Reviewed-by: kaylareopelle Refs: open-telemetry#1172 --------- Co-authored-by: Kayla Reopelle <[email protected]> Co-authored-by: Ariel Valentin <[email protected]>
* feat: add grpc instrumentation See <https://github.com/hibachrach/opentelemetry-instrumentation-grpc/> for previous git history * Apply suggestions from code review * chore: Markdown lint, class updates for CI * Update instrumentation/grpc/README.md --------- Co-authored-by: Kayla Reopelle <[email protected]> Co-authored-by: Kayla Reopelle <[email protected]>
* release: Release 20 gems * opentelemetry-processor-baggage 0.2.1 (was 0.2.0) * opentelemetry-resource-detector-azure 0.1.1 (was 0.1.0) * opentelemetry-resource-detector-container 0.1.2 (was 0.1.1) * opentelemetry-resource-detector-google_cloud_platform 0.1.1 (was 0.1.0) * opentelemetry-propagator-ottrace 0.21.4 (was 0.21.3) * opentelemetry-propagator-vitess 0.1.1 (was 0.1.0) * opentelemetry-propagator-xray 0.22.3 (was 0.22.2) * opentelemetry-helpers-mysql 0.1.2 (was 0.1.1) * opentelemetry-helpers-sql-obfuscation 0.2.1 (was 0.2.0) * opentelemetry-instrumentation-all 0.69.1 (was 0.69.0) * opentelemetry-instrumentation-rails 0.33.1 (was 0.33.0) * opentelemetry-instrumentation-ethon 0.21.9 (was 0.21.8) * opentelemetry-instrumentation-excon 0.22.5 (was 0.22.4) * opentelemetry-instrumentation-faraday 0.24.7 (was 0.24.6) * opentelemetry-instrumentation-http 0.23.5 (was 0.23.4) * opentelemetry-instrumentation-http_client 0.22.8 (was 0.22.7) * opentelemetry-instrumentation-httpx 0.1.3 (was 0.1.2) * opentelemetry-instrumentation-net_http 0.22.8 (was 0.22.7) * opentelemetry-instrumentation-restclient 0.22.8 (was 0.22.7) * opentelemetry-instrumentation-pg 0.29.1 (was 0.29.0) * squash: Apply suggestions from code review --------- Co-authored-by: OpenTelemetry Bot <[email protected]> Co-authored-by: Ariel Valentin <[email protected]>
* fix: use AS::N subscriber for serialize events The details for Context management (i.e. setting current span) are already handled by the OTel ActiveSupport instrumentation. Reuse the notifications subscriber here for ActiveModel serialization events. Reworked the example app into two: one Rails which works with the usual SDK configuration and one standalone (no Rails) to demonstrate that the subscription needs to be made after the SDK configuration is complete. If the subscription is created during instrumentation install, the subscription's tracer will be a NO-OP API tracer and won't produce spans. * update comments to reference Rails components consistently Co-authored-by: Kayla Reopelle <[email protected]> * default to console exporter ... but leave OTLP exporter gem in dependencies so that a curious person can override without code changes to send to some OTLP receiver by setting the appropriate environment variables. * differentiate example app output from trace console output * fixup! default to console exporter * fixup! differentiate example app output from trace console output --------- Co-authored-by: Kayla Reopelle <[email protected]> Co-authored-by: Ariel Valentin <[email protected]>
…rs 0.20.3 (was 0.20.2) (open-telemetry#1287) * release: Release opentelemetry-instrumentation-active_model_serializers 0.20.3 (was 0.20.2) * docs: Update instrumentation/active_model_serializers/CHANGELOG.md * ci: Workaround for JRuby Fixes open-telemetry#1289 * squash: Make the release tooling happy --------- Co-authored-by: OpenTelemetry Bot <[email protected]> Co-authored-by: Ariel Valentin <[email protected]> Co-authored-by: Ariel Valentin <[email protected]>
* Add references to released logs gems * Test Rails 7.0 - 8.0 * Rubocop * Set gem version
…ntelemetry-ruby-contrib into logger-instrumentation
Test the outcome rather than the presence of variables
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.
This PR leverages the Logs SDK implementation pending review in kaylareopelle/opentelemetry-ruby#6 to instrument Ruby's Logger class.
It also includes a workaround to prevent broadcasted logs in Rails < 7.1 from creating duplicate log records.
Co-Authored by: @khushijain21