diff --git a/.github/workflows/release-hook-on-closed.yml b/.github/workflows/release-hook-on-closed.yml index bbbcfd735..7b00cdc54 100644 --- a/.github/workflows/release-hook-on-closed.yml +++ b/.github/workflows/release-hook-on-closed.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - name: Install Toys - run: "gem install --no-document toys" + run: "gem install --no-document toys -v 0.15.1" - name: Process release request env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-hook-on-push.yml b/.github/workflows/release-hook-on-push.yml index 1dfc480fd..23ed4912c 100644 --- a/.github/workflows/release-hook-on-push.yml +++ b/.github/workflows/release-hook-on-push.yml @@ -19,7 +19,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - name: Install Toys - run: "gem install --no-document toys" + run: "gem install --no-document toys -v 0.15.1" - name: Update open releases env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-perform.yml b/.github/workflows/release-perform.yml index 4e8b37bc6..105ae542c 100644 --- a/.github/workflows/release-perform.yml +++ b/.github/workflows/release-perform.yml @@ -28,7 +28,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - name: Install Toys - run: "gem install --no-document toys" + run: "gem install --no-document toys -v 0.15.1" - name: Perform release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-request.yml b/.github/workflows/release-request.yml index 964847450..f0ab20957 100644 --- a/.github/workflows/release-request.yml +++ b/.github/workflows/release-request.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - name: Install Toys - run: "gem install --no-document toys" + run: "gem install --no-document toys -v 0.15.1" - name: Open release pull request env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-retry.yml b/.github/workflows/release-retry.yml index dd5c3a81c..7b8d42afe 100644 --- a/.github/workflows/release-retry.yml +++ b/.github/workflows/release-retry.yml @@ -25,7 +25,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - name: Install Toys - run: "gem install --no-document toys" + run: "gem install --no-document toys -v 0.15.1" - name: Retry release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.toys/.toys.rb b/.toys/.toys.rb index 76d3765c5..11f265b72 100644 --- a/.toys/.toys.rb +++ b/.toys/.toys.rb @@ -1,7 +1,7 @@ -toys_version! "0.14.7" +toys_version! "0.15.1" load_git remote: "https://github.com/dazuma/toys.git", path: ".toys/release", as: "release", - commit: "toys/v0.14.7", + commit: "toys/v0.15.1", update: 3600 diff --git a/CODEOWNERS b/CODEOWNERS index ee9e46837..ff2a9eb21 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -12,7 +12,7 @@ # https://help.github.com/en/articles/about-code-owners # -* @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd +* @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @open-telemetry/ruby-contrib-approvers resources/container/ @scbjans @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd diff --git a/instrumentation/action_pack/Appraisals b/instrumentation/action_pack/Appraisals index 936cb892f..018ce75b2 100644 --- a/instrumentation/action_pack/Appraisals +++ b/instrumentation/action_pack/Appraisals @@ -11,3 +11,7 @@ end appraise 'rails-7.0' do gem 'rails', '~> 7.0.0' end + +appraise 'rails-7.1' do + gem 'rails', '~> 7.1.0' +end diff --git a/instrumentation/action_pack/CHANGELOG.md b/instrumentation/action_pack/CHANGELOG.md index 957d32f8d..422b99960 100644 --- a/instrumentation/action_pack/CHANGELOG.md +++ b/instrumentation/action_pack/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-action_pack +### v0.7.1 / 2023-10-16 + +* FIXED: Add Rails 7.1 compatibility + ### v0.7.0 / 2023-06-05 * ADDED: Use Rack Middleware Helper diff --git a/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb b/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb index 0f344d159..a33cf47dd 100644 --- a/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb +++ b/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActionPack - VERSION = '0.7.0' + VERSION = '0.7.1' end end end diff --git a/instrumentation/action_view/Appraisals b/instrumentation/action_view/Appraisals index 936cb892f..018ce75b2 100644 --- a/instrumentation/action_view/Appraisals +++ b/instrumentation/action_view/Appraisals @@ -11,3 +11,7 @@ end appraise 'rails-7.0' do gem 'rails', '~> 7.0.0' end + +appraise 'rails-7.1' do + gem 'rails', '~> 7.1.0' +end diff --git a/instrumentation/action_view/CHANGELOG.md b/instrumentation/action_view/CHANGELOG.md index 2cdacb9d1..c6d8759b9 100644 --- a/instrumentation/action_view/CHANGELOG.md +++ b/instrumentation/action_view/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-action_view +### v0.6.1 / 2023-10-16 + +* FIXED: Add Rails 7.1 compatibility + ### v0.6.0 / 2023-06-05 * ADDED: Render layout for action view diff --git a/instrumentation/action_view/lib/opentelemetry/instrumentation/action_view/version.rb b/instrumentation/action_view/lib/opentelemetry/instrumentation/action_view/version.rb index 7fdbddebc..9daf5e233 100644 --- a/instrumentation/action_view/lib/opentelemetry/instrumentation/action_view/version.rb +++ b/instrumentation/action_view/lib/opentelemetry/instrumentation/action_view/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActionView - VERSION = '0.6.0' + VERSION = '0.6.1' end end end diff --git a/instrumentation/active_job/Appraisals b/instrumentation/active_job/Appraisals index 842dcecfd..05429cd62 100644 --- a/instrumentation/active_job/Appraisals +++ b/instrumentation/active_job/Appraisals @@ -4,10 +4,8 @@ # # SPDX-License-Identifier: Apache-2.0 -appraise 'activejob-6.1' do - gem 'activejob', '~> 6.1.0' -end - -appraise 'activejob-7.0' do - gem 'activejob', '~> 7.0.0' +%w[6.1.0 7.0.0 7.1.0].each do |version| + appraise "activejob-#{version}" do + gem 'activejob', "~> #{version}" + end end diff --git a/instrumentation/active_job/CHANGELOG.md b/instrumentation/active_job/CHANGELOG.md index fdc4420c9..2bccc6b3a 100644 --- a/instrumentation/active_job/CHANGELOG.md +++ b/instrumentation/active_job/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-active_job +### v0.6.1 / 2023-10-16 + +* FIXED: Add Rails 7.1 compatibility + ### v0.6.0 / 2023-09-07 * FIXED: Align messaging instrumentation operation names diff --git a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/patches/active_job_callbacks.rb b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/patches/active_job_callbacks.rb index c3f612599..973025352 100644 --- a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/patches/active_job_callbacks.rb +++ b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/patches/active_job_callbacks.rb @@ -73,7 +73,7 @@ def job_attributes(job) 'messaging.destination' => job.queue_name, 'messaging.message_id' => job.job_id, 'messaging.active_job.provider_job_id' => job.provider_job_id, - 'messaging.active_job.scheduled_at' => job.scheduled_at, + 'messaging.active_job.scheduled_at' => job.scheduled_at&.to_f, 'messaging.active_job.priority' => job.priority } diff --git a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb index 5d7f6add4..2a4dc878d 100644 --- a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb +++ b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActiveJob - VERSION = '0.6.0' + VERSION = '0.6.1' end end end diff --git a/instrumentation/active_job/test/instrumentation/active_job/patches/active_job_callbacks_test.rb b/instrumentation/active_job/test/instrumentation/active_job/patches/active_job_callbacks_test.rb index f2c6f996c..c5c59d95e 100644 --- a/instrumentation/active_job/test/instrumentation/active_job/patches/active_job_callbacks_test.rb +++ b/instrumentation/active_job/test/instrumentation/active_job/patches/active_job_callbacks_test.rb @@ -162,14 +162,21 @@ end end - it 'is set correctly for jobs that do wait' do + it 'records the scheduled at time for apps running Rails 7.1 and newer' do + skip 'scheduled jobs behave differently in Rails 7.1+' if ActiveJob.version < Gem::Version.new('7.1') + job = TestJob.set(wait: 0.second).perform_later - # Only the sending span is a 'scheduled' thing - _(publish_span.attributes['messaging.active_job.scheduled_at']).must_equal(job.scheduled_at) - assert(publish_span.attributes['messaging.active_job.scheduled_at']) + _(publish_span.attributes['messaging.active_job.scheduled_at']).must_equal(job.scheduled_at.to_f) + _(process_span.attributes['messaging.active_job.scheduled_at']).must_equal(job.scheduled_at.to_f) + end + + it 'records the scheduled at time for apps running Rails 7.0 or older' do + skip 'scheduled jobs behave differently in Rails 7.1+' if ActiveJob.version >= Gem::Version.new('7.1') + + job = TestJob.set(wait: 0.second).perform_later - # The processing span isn't a 'scheduled' thing + _(publish_span.attributes['messaging.active_job.scheduled_at']).must_equal(job.scheduled_at.to_f) _(process_span.attributes['messaging.active_job.scheduled_at']).must_be_nil end end diff --git a/instrumentation/active_record/Appraisals b/instrumentation/active_record/Appraisals index 1459fcfe0..36f3effee 100644 --- a/instrumentation/active_record/Appraisals +++ b/instrumentation/active_record/Appraisals @@ -11,3 +11,7 @@ end appraise 'activerecord-7.0' do gem 'activerecord', '~> 7.0.0' end + +appraise 'activerecord-7.1' do + gem 'activerecord', '~> 7.1.0' +end diff --git a/instrumentation/active_record/CHANGELOG.md b/instrumentation/active_record/CHANGELOG.md index 1d0d48f84..4896addb4 100644 --- a/instrumentation/active_record/CHANGELOG.md +++ b/instrumentation/active_record/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-active_record +### v0.6.3 / 2023-10-16 + +* FIXED: Add Rails 7.1 compatibility + ### v0.6.2 / 2023-08-14 * FIXED: Ensure that transaction name property is used, rather than self diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb index add97fb06..bdd1f1083 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActiveRecord - VERSION = '0.6.2' + VERSION = '0.6.3' end end end diff --git a/instrumentation/active_support/Appraisals b/instrumentation/active_support/Appraisals index ec985430d..086c10ee9 100644 --- a/instrumentation/active_support/Appraisals +++ b/instrumentation/active_support/Appraisals @@ -11,3 +11,7 @@ end appraise 'activesupport-7.0' do gem 'activesupport', '~> 7.0.0' end + +appraise 'activesupport-7.1' do + gem 'activesupport', '~> 7.1.0' +end diff --git a/instrumentation/active_support/CHANGELOG.md b/instrumentation/active_support/CHANGELOG.md index b2ad56d80..9093048a0 100644 --- a/instrumentation/active_support/CHANGELOG.md +++ b/instrumentation/active_support/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-active_support +### v0.4.3 / 2023-10-16 + +* FIXED: Add Rails 7.1 compatibility + ### v0.4.2 / 2023-09-07 FIXED: Reduce Object allocation diff --git a/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/version.rb b/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/version.rb index bb7b408cc..c159609b9 100644 --- a/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/version.rb +++ b/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActiveSupport - VERSION = '0.4.2' + VERSION = '0.4.3' end end end diff --git a/instrumentation/all/CHANGELOG.md b/instrumentation/all/CHANGELOG.md index c81851ebf..60a028a1a 100644 --- a/instrumentation/all/CHANGELOG.md +++ b/instrumentation/all/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-all +### v0.51.0 / 2023-10-16 + +* CHANGED: See [#695](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/695) for details + ### v0.50.1 / 2023-09-07 * FIXED: Align messaging instrumentation operation names (Resque) diff --git a/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb b/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb index 038f4e9a2..073a0deea 100644 --- a/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb +++ b/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module All - VERSION = '0.50.1' + VERSION = '0.51.0' end end end diff --git a/instrumentation/all/opentelemetry-instrumentation-all.gemspec b/instrumentation/all/opentelemetry-instrumentation-all.gemspec index 0bb1151ac..e3506b365 100644 --- a/instrumentation/all/opentelemetry-instrumentation-all.gemspec +++ b/instrumentation/all/opentelemetry-instrumentation-all.gemspec @@ -30,8 +30,8 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-instrumentation-aws_sdk', '~> 0.5.0' spec.add_dependency 'opentelemetry-instrumentation-bunny', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.21.1' - spec.add_dependency 'opentelemetry-instrumentation-dalli', '~> 0.24.1' - spec.add_dependency 'opentelemetry-instrumentation-delayed_job', '~> 0.21.0' + spec.add_dependency 'opentelemetry-instrumentation-dalli', '~> 0.25.0' + spec.add_dependency 'opentelemetry-instrumentation-delayed_job', '~> 0.22.0' spec.add_dependency 'opentelemetry-instrumentation-ethon', '~> 0.21.1' spec.add_dependency 'opentelemetry-instrumentation-excon', '~> 0.21.1' spec.add_dependency 'opentelemetry-instrumentation-faraday', '~> 0.23.1' @@ -43,9 +43,9 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-instrumentation-koala', '~> 0.20.1' spec.add_dependency 'opentelemetry-instrumentation-lmdb', '~> 0.22.1' spec.add_dependency 'opentelemetry-instrumentation-mongo', '~> 0.22.1' - spec.add_dependency 'opentelemetry-instrumentation-mysql2', '~> 0.24.2' + spec.add_dependency 'opentelemetry-instrumentation-mysql2', '~> 0.25.0' spec.add_dependency 'opentelemetry-instrumentation-net_http', '~> 0.22.1' - spec.add_dependency 'opentelemetry-instrumentation-pg', '~> 0.25.2' + spec.add_dependency 'opentelemetry-instrumentation-pg', '~> 0.26.0' spec.add_dependency 'opentelemetry-instrumentation-que', '~> 0.7.0' spec.add_dependency 'opentelemetry-instrumentation-racecar', '~> 0.3.0' spec.add_dependency 'opentelemetry-instrumentation-rack', '~> 0.23.1' diff --git a/instrumentation/dalli/CHANGELOG.md b/instrumentation/dalli/CHANGELOG.md index 3b2e198bd..1a89d2a85 100644 --- a/instrumentation/dalli/CHANGELOG.md +++ b/instrumentation/dalli/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History: opentelemetry-instrumentation-dalli +### v0.25.0 / 2023-10-16 + +* BREAKING CHANGE: Obfuscation for mysql2, dalli and postgresql as default option for db_statement + +* ADDED: Obfuscation for mysql2, dalli and postgresql as default option for db_statement + ### v0.24.2 / 2023-07-21 * ADDED: Update `opentelemetry-common` from [0.19.3 to 0.20.0](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/537) diff --git a/instrumentation/dalli/README.md b/instrumentation/dalli/README.md index 3f0efd4c6..bf4f988fa 100644 --- a/instrumentation/dalli/README.md +++ b/instrumentation/dalli/README.md @@ -30,6 +30,22 @@ OpenTelemetry::SDK.configure do |c| end ``` +### Configuration options + +```ruby +OpenTelemetry::SDK.configure do |c| + c.use 'OpenTelemetry::Instrumentation::Dalli', { + # You may optionally set a value for 'peer.service', which + # will be included on all spans from this instrumentation: + peer_service: '', + + # The obfuscation of query in the db.statement attribute is enabled by default. + # To disable, set db_statement to :include; to omit the query completely, set db_statement to :omit + db_statement: :include, + } +end +``` + ## How can I get involved? The `opentelemetry-instrumentation-dalli` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`. diff --git a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb index 014f38ccd..610bf5a5f 100644 --- a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb +++ b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb @@ -20,7 +20,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base end option :peer_service, default: nil, validate: :string - option :db_statement, default: :include, validate: %I[omit obfuscate include] + option :db_statement, default: :obfuscate, validate: %I[omit obfuscate include] private diff --git a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb index 424f56834..a5f393b3b 100644 --- a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb +++ b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Dalli - VERSION = '0.24.2' + VERSION = '0.25.0' end end end diff --git a/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb b/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb index d426a4bf3..512ba0359 100644 --- a/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb +++ b/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb @@ -28,7 +28,7 @@ describe 'tracing' do before do - instrumentation.install + instrumentation.install(db_statement: :include) end it 'accepts peer service name from config' do diff --git a/instrumentation/delayed_job/Appraisals b/instrumentation/delayed_job/Appraisals index c3e9b24a2..61ac8e82d 100644 --- a/instrumentation/delayed_job/Appraisals +++ b/instrumentation/delayed_job/Appraisals @@ -4,6 +4,14 @@ # # SPDX-License-Identifier: Apache-2.0 -appraise 'delayed_job-4.1' do - gem 'delayed_job', '~> 4.1.0' +appraise 'delayed_job_4.1-rails-7.1' do + gem 'activejob', '~> 7.1.0' +end + +appraise 'delayed_job_4.1-rails-7.0' do + gem 'activejob', '~> 7.0.0' +end + +appraise 'delayed_job-4.1-rails-6.1' do + gem 'activejob', '~> 6.1.0' end diff --git a/instrumentation/delayed_job/CHANGELOG.md b/instrumentation/delayed_job/CHANGELOG.md index 67b9f9441..be2e302cb 100644 --- a/instrumentation/delayed_job/CHANGELOG.md +++ b/instrumentation/delayed_job/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History: opentelemetry-instrumentation-delayed_job +### v0.22.0 / 2023-10-16 + +* BREAKING CHANGE: Drop DelayedJob ActiveRecord in Tests + +* FIXED: Drop DelayedJob ActiveRecord in Tests + ### v0.21.0 / 2023-09-07 * FIXED: Align messaging instrumentation operation names diff --git a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb index fccba0641..304868adb 100644 --- a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb +++ b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb @@ -56,7 +56,6 @@ def build_attributes(job) end def add_events(span, job) - span.add_event('created_at', timestamp: job.created_at) span.add_event('run_at', timestamp: job.run_at) if job.run_at span.add_event('locked_at', timestamp: job.locked_at) if job.locked_at end diff --git a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb index 989bf86fb..8f3f46f79 100644 --- a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb +++ b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module DelayedJob - VERSION = '0.21.0' + VERSION = '0.22.0' end end end diff --git a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec index 86648b55b..9978617c2 100644 --- a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec +++ b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec @@ -30,8 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'delayed_job', '~> 4.1.0' - spec.add_development_dependency 'delayed_job_active_record' + spec.add_development_dependency 'delayed_job', '~> 4.1.7' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin_test.rb b/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin_test.rb index 2f358cefe..85f8f7464 100644 --- a/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin_test.rb +++ b/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin_test.rb @@ -16,8 +16,7 @@ let(:span) { exporter.finished_spans.last } before do - TestHelper.setup_active_record - + Delayed::Worker.backend.delete_all stub_const('BasicPayload', Class.new do def perform; end end) @@ -50,8 +49,6 @@ def job_data after do OpenTelemetry.propagation = @orig_propagation - - TestHelper.teardown_active_record end describe 'enqueue callback' do @@ -74,11 +71,9 @@ def job_data _(span.attributes['messaging.operation']).must_equal 'publish' _(span.attributes['messaging.message_id']).must_be_kind_of String - _(span.events.size).must_equal 2 - _(span.events[0].name).must_equal 'created_at' + _(span.events.size).must_equal 1 + _(span.events[0].name).must_equal 'run_at' _(span.events[0].timestamp).must_be_kind_of Integer - _(span.events[1].name).must_equal 'run_at' - _(span.events[1].timestamp).must_be_kind_of Integer end describe 'when queue name is set' do @@ -124,7 +119,6 @@ def job_data _(exporter.finished_spans.size).must_equal 1 _(exporter.finished_spans.first.name).must_equal 'default publish' job_run - _(exporter.finished_spans.size).must_equal 2 _(span).must_be_kind_of OpenTelemetry::SDK::Trace::SpanData _(span.name).must_equal 'default process' @@ -138,17 +132,15 @@ def job_data _(span.attributes['messaging.operation']).must_equal 'process' _(span.attributes['messaging.message_id']).must_be_kind_of String - _(span.events.size).must_equal 3 - _(span.events[0].name).must_equal 'created_at' + _(span.events[0].name).must_equal 'run_at' _(span.events[0].timestamp).must_be_kind_of Integer - _(span.events[1].name).must_equal 'run_at' + _(span.events[1].name).must_equal 'locked_at' _(span.events[1].timestamp).must_be_kind_of Integer - _(span.events[2].name).must_equal 'locked_at' - _(span.events[2].timestamp).must_be_kind_of Integer end describe 'when queue name is set' do let(:job_params) { { queue: 'foobar_queue' } } + let(:job_enqueue) { Delayed::Job.enqueue(@basic_payload.new, job_params) } it 'span tags include queue name' do job_run @@ -181,11 +173,10 @@ def job_data it 'has resource name equal to underlying ActiveJob class name' do job_run _(span.attributes['messaging.delayed_job.name']).must_equal 'ErrorPayload' - _(span.events.size).must_equal 4 - _(span.events[3].name).must_equal 'exception' - _(span.events[3].timestamp).must_be_kind_of Integer - _(span.events[3].attributes['exception.type']).must_equal 'ArgumentError' - _(span.events[3].attributes['exception.message']).must_equal 'This job failed' + _(span.events[2].name).must_equal 'exception' + _(span.events[2].timestamp).must_be_kind_of Integer + _(span.events[2].attributes['exception.type']).must_equal 'ArgumentError' + _(span.events[2].attributes['exception.message']).must_equal 'This job failed' end end end diff --git a/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job_test.rb b/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job_test.rb index 33ad547bd..907122b34 100644 --- a/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job_test.rb +++ b/instrumentation/delayed_job/test/opentelemetry/instrumentation/delayed_job_test.rb @@ -11,6 +11,7 @@ let(:exporter) { EXPORTER } before do + Delayed::Worker.backend.delete_all instrumentation.install exporter.reset end @@ -48,14 +49,6 @@ end describe 'tracing' do - before do - TestHelper.setup_active_record - end - - after do - TestHelper.teardown_active_record - end - it 'before job' do _(exporter.finished_spans.size).must_equal 0 end diff --git a/instrumentation/delayed_job/test/test_helper.rb b/instrumentation/delayed_job/test/test_helper.rb index 76ff7bba1..3b5b70195 100644 --- a/instrumentation/delayed_job/test/test_helper.rb +++ b/instrumentation/delayed_job/test/test_helper.rb @@ -7,8 +7,13 @@ require 'bundler/setup' Bundler.require(:default, :development, :test) +# These are dependencies that delayed job assumes are already loaded +# We are compensating for that here in this test... that is a smell +# NoMethodError: undefined method `extract_options!' for [#, {}]:Array +# delayed_job-4.1.11/lib/delayed/backend/job_preparer.rb:7:in `initialize'0 +require 'active_support/core_ext/array/extract_options' + require 'opentelemetry-instrumentation-delayed_job' -require 'active_support/core_ext/kernel/reporting' require 'minitest/autorun' require 'rspec/mocks/minitest_integration' @@ -24,31 +29,7 @@ c.add_span_processor span_processor end -ActiveRecord::Migration.verbose = false - -module TestHelper - extend self - - def setup_active_record - ::ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') - ::ActiveRecord::Schema.define do - create_table 'delayed_jobs', force: :cascade do |t| - t.integer 'priority', default: 0, null: false - t.integer 'attempts', default: 0, null: false - t.text 'handler', null: false - t.text 'last_error' - t.datetime 'run_at' - t.datetime 'locked_at' - t.datetime 'failed_at' - t.string 'locked_by' - t.string 'queue' - t.datetime 'created_at' - t.datetime 'updated_at' - end - end - end - - def teardown_active_record - ::ActiveRecord::Base.connection.close - end -end +gem_dir = Gem::Specification.find_by_name('delayed_job').gem_dir +require "#{gem_dir}/spec/delayed/backend/test" + +Delayed::Worker.backend = Delayed::Backend::Test::Job diff --git a/instrumentation/faraday/CHANGELOG.md b/instrumentation/faraday/CHANGELOG.md index 6c9384049..fa06abffe 100644 --- a/instrumentation/faraday/CHANGELOG.md +++ b/instrumentation/faraday/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-faraday +### v0.23.3 / 2023-10-16 + +* FIXED: Omit `nil` `net.peer.name` attributes + ### v0.23.2 / 2023-07-21 * ADDED: Update `opentelemetry-common` from [0.19.3 to 0.20.0](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/537) diff --git a/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware.rb b/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware.rb index be880c0ae..c6b73c3c9 100644 --- a/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware.rb +++ b/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware.rb @@ -44,9 +44,9 @@ def call(env) def span_creation_attributes(http_method:, url:) instrumentation_attrs = { 'http.method' => http_method, - 'http.url' => OpenTelemetry::Common::Utilities.cleanse_url(url.to_s), - 'net.peer.name' => url.host + 'http.url' => OpenTelemetry::Common::Utilities.cleanse_url(url.to_s) } + instrumentation_attrs['net.peer.name'] = url.host if url.host config = Faraday::Instrumentation.instance.config instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service] instrumentation_attrs.merge!( diff --git a/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb b/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb index 2df7a1f27..f4cb955f3 100644 --- a/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb +++ b/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Faraday - VERSION = '0.23.2' + VERSION = '0.23.3' end end end diff --git a/instrumentation/faraday/test/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware_test.rb b/instrumentation/faraday/test/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware_test.rb index f9f9617fb..417c0c367 100644 --- a/instrumentation/faraday/test/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware_test.rb +++ b/instrumentation/faraday/test/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware_test.rb @@ -42,89 +42,114 @@ instrumentation.install end - it 'has http 200 attributes' do - response = client.get('/success') - - _(span.name).must_equal 'HTTP GET' - _(span.attributes['http.method']).must_equal 'GET' - _(span.attributes['http.status_code']).must_equal 200 - _(span.attributes['http.url']).must_equal 'http://example.com/success' - _(span.attributes['net.peer.name']).must_equal 'example.com' - _(response.env.request_headers['Traceparent']).must_equal( - "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" - ) - end + describe 'given a client with a base url' do + it 'has http 200 attributes' do + response = client.get('/success') + + _(span.name).must_equal 'HTTP GET' + _(span.attributes['http.method']).must_equal 'GET' + _(span.attributes['http.status_code']).must_equal 200 + _(span.attributes['http.url']).must_equal 'http://example.com/success' + _(span.attributes['net.peer.name']).must_equal 'example.com' + _(response.env.request_headers['Traceparent']).must_equal( + "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" + ) + end - it 'has http.status_code 404' do - response = client.get('/not_found') - - _(span.name).must_equal 'HTTP GET' - _(span.attributes['http.method']).must_equal 'GET' - _(span.attributes['http.status_code']).must_equal 404 - _(span.attributes['http.url']).must_equal 'http://example.com/not_found' - _(span.attributes['net.peer.name']).must_equal 'example.com' - _(response.env.request_headers['Traceparent']).must_equal( - "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" - ) - end + it 'has http.status_code 404' do + response = client.get('/not_found') + + _(span.name).must_equal 'HTTP GET' + _(span.attributes['http.method']).must_equal 'GET' + _(span.attributes['http.status_code']).must_equal 404 + _(span.attributes['http.url']).must_equal 'http://example.com/not_found' + _(span.attributes['net.peer.name']).must_equal 'example.com' + _(response.env.request_headers['Traceparent']).must_equal( + "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" + ) + end - it 'has http.status_code 500' do - response = client.get('/failure') - - _(span.name).must_equal 'HTTP GET' - _(span.attributes['http.method']).must_equal 'GET' - _(span.attributes['http.status_code']).must_equal 500 - _(span.attributes['http.url']).must_equal 'http://example.com/failure' - _(span.attributes['net.peer.name']).must_equal 'example.com' - _(response.env.request_headers['Traceparent']).must_equal( - "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" - ) - end + it 'has http.status_code 500' do + response = client.get('/failure') + + _(span.name).must_equal 'HTTP GET' + _(span.attributes['http.method']).must_equal 'GET' + _(span.attributes['http.status_code']).must_equal 500 + _(span.attributes['http.url']).must_equal 'http://example.com/failure' + _(span.attributes['net.peer.name']).must_equal 'example.com' + _(response.env.request_headers['Traceparent']).must_equal( + "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" + ) + end - it 'merges http client attributes' do - client_context_attrs = { - 'test.attribute' => 'test.value', 'http.method' => 'OVERRIDE' - } - response = OpenTelemetry::Common::HTTP::ClientContext.with_attributes(client_context_attrs) do - client.get('/success') + it 'merges http client attributes' do + client_context_attrs = { + 'test.attribute' => 'test.value', 'http.method' => 'OVERRIDE' + } + response = OpenTelemetry::Common::HTTP::ClientContext.with_attributes(client_context_attrs) do + client.get('/success') + end + + _(span.name).must_equal 'HTTP GET' + _(span.attributes['http.method']).must_equal 'OVERRIDE' + _(span.attributes['http.status_code']).must_equal 200 + _(span.attributes['http.url']).must_equal 'http://example.com/success' + _(span.attributes['net.peer.name']).must_equal 'example.com' + _(span.attributes['test.attribute']).must_equal 'test.value' + _(response.env.request_headers['Traceparent']).must_equal( + "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" + ) end - _(span.name).must_equal 'HTTP GET' - _(span.attributes['http.method']).must_equal 'OVERRIDE' - _(span.attributes['http.status_code']).must_equal 200 - _(span.attributes['http.url']).must_equal 'http://example.com/success' - _(span.attributes['net.peer.name']).must_equal 'example.com' - _(span.attributes['test.attribute']).must_equal 'test.value' - _(response.env.request_headers['Traceparent']).must_equal( - "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" - ) - end + it 'accepts peer service name from config' do + instrumentation.instance_variable_set(:@installed, false) + instrumentation.install(peer_service: 'example:faraday') - it 'accepts peer service name from config' do - instrumentation.instance_variable_set(:@installed, false) - instrumentation.install(peer_service: 'example:faraday') + client.get('/success') - client.get('/success') + _(span.attributes['peer.service']).must_equal 'example:faraday' + end - _(span.attributes['peer.service']).must_equal 'example:faraday' - end + it 'prioritizes context attributes over config for peer service name' do + instrumentation.instance_variable_set(:@installed, false) + instrumentation.install(peer_service: 'example:faraday') - it 'prioritizes context attributes over config for peer service name' do - instrumentation.instance_variable_set(:@installed, false) - instrumentation.install(peer_service: 'example:faraday') + client_context_attrs = { 'peer.service' => 'example:custom' } + OpenTelemetry::Common::HTTP::ClientContext.with_attributes(client_context_attrs) do + client.get('/success') + end - client_context_attrs = { 'peer.service' => 'example:custom' } - OpenTelemetry::Common::HTTP::ClientContext.with_attributes(client_context_attrs) do - client.get('/success') + _(span.attributes['peer.service']).must_equal 'example:custom' end - _(span.attributes['peer.service']).must_equal 'example:custom' + it 'does not leak authentication credentials' do + client.run_request(:get, 'http://username:password@example.com/success', nil, {}) + + _(span.attributes['http.url']).must_equal 'http://example.com/success' + end end - it 'does not leak authentication credentials' do - client.run_request(:get, 'http://username:password@example.com/success', nil, {}) + describe 'given a client without a base url' do + let(:client) do + Faraday.new do |builder| + builder.adapter(:test) do |stub| + stub.get('/success') { |_| [200, {}, 'OK'] } + end + end + end - _(span.attributes['http.url']).must_equal 'http://example.com/success' + it 'omits missing attributes' do + response = client.get('/success') + + _(span.name).must_equal 'HTTP GET' + _(span.attributes['http.method']).must_equal 'GET' + _(span.attributes['http.status_code']).must_equal 200 + _(span.attributes['http.url']).must_equal 'http:/success' + _(span.attributes).wont_include('net.peer.name') + _(response.env.request_headers['Traceparent']).must_equal( + "00-#{span.hex_trace_id}-#{span.hex_span_id}-01" + ) + end end end end diff --git a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb index 26b2cf6a2..5d4111b74 100644 --- a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb +++ b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb @@ -97,8 +97,7 @@ after do # Reset various instance variables to clear state between tests - SomeOtherGraphQLAppSchema.instance_variable_set(:@own_tracers, []) - SomeOtherGraphQLAppSchema.instance_variable_set(:@own_plugins, SomeOtherGraphQLAppSchema.plugins[0..1]) + [GraphQL::Schema, SomeOtherGraphQLAppSchema, SomeGraphQLAppSchema].each(&:_reset_tracer_for_testing) end it 'traces the provided schemas' do diff --git a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_tracer_test.rb b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_tracer_test.rb index 496580bee..35e5e4b0d 100644 --- a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_tracer_test.rb +++ b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_tracer_test.rb @@ -97,13 +97,11 @@ after do # Reset various instance variables to clear state between tests - SomeOtherGraphQLAppSchema.instance_variable_set(:@own_tracers, []) - SomeOtherGraphQLAppSchema.instance_variable_set(:@own_plugins, SomeOtherGraphQLAppSchema.plugins[0..1]) + [GraphQL::Schema, SomeOtherGraphQLAppSchema, SomeGraphQLAppSchema].each(&:_reset_tracer_for_testing) end it 'traces the provided schemas' do SomeOtherGraphQLAppSchema.execute('query SimpleQuery{ __typename }') - _(spans.size).must_equal(8) end diff --git a/instrumentation/graphql/test/test_helper.rb b/instrumentation/graphql/test/test_helper.rb index 330b3d836..75f349b28 100644 --- a/instrumentation/graphql/test/test_helper.rb +++ b/instrumentation/graphql/test/test_helper.rb @@ -25,7 +25,7 @@ module SchemaTestPatches # Reseting @graphql_definition is needed for tests running against version `1.9.x` # Other variables are used by ~> 2.0.19 def _reset_tracer_for_testing - %w[own_tracers trace_modes trace_class tracers graphql_definition].each do |ivar| + %w[own_tracers trace_modes trace_class tracers graphql_definition own_trace_modes].each do |ivar| remove_instance_variable("@#{ivar}") if instance_variable_defined?("@#{ivar}") end end diff --git a/instrumentation/gruf/CHANGELOG.md b/instrumentation/gruf/CHANGELOG.md index 8cdbb4f4a..43137ffc8 100644 --- a/instrumentation/gruf/CHANGELOG.md +++ b/instrumentation/gruf/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-gruf +### v0.1.1 / 2023-10-16 + +* FIXED: Remove activesupport dependency + ### v0.1.0 / 2023-08-07 * Initial release! diff --git a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/client.rb b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/client.rb index d1c28022f..ffb69973f 100644 --- a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/client.rb +++ b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/client.rb @@ -10,7 +10,7 @@ module Gruf module Interceptors class Client < ::Gruf::Interceptors::ClientInterceptor def call(request_context:) - return yield if instrumentation_config.blank? + return yield if instrumentation_config.empty? service = request_context.method.split('/')[1] method = request_context.method_name diff --git a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/server.rb b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/server.rb index 5609d9c63..fec68f357 100644 --- a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/server.rb +++ b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/interceptors/server.rb @@ -10,7 +10,7 @@ module Gruf module Interceptors class Server < ::Gruf::Interceptors::ServerInterceptor def call - return yield if instrumentation_config.blank? + return yield if instrumentation_config.empty? method = request.method_name diff --git a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb index 0c87d64fe..2b36b7e53 100644 --- a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb +++ b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Gruf - VERSION = '0.1.0' + VERSION = '0.1.1' end end end diff --git a/instrumentation/mysql2/CHANGELOG.md b/instrumentation/mysql2/CHANGELOG.md index 4b56ee1a2..c27f08105 100644 --- a/instrumentation/mysql2/CHANGELOG.md +++ b/instrumentation/mysql2/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History: opentelemetry-instrumentation-mysql2 +### v0.25.0 / 2023-10-16 + +* BREAKING CHANGE: Obfuscation for mysql2, dalli and postgresql as default option for db_statement + +* ADDED: Obfuscation for mysql2, dalli and postgresql as default option for db_statement + ### v0.24.3 / 2023-08-03 * FIXED: Remove inline linter rules diff --git a/instrumentation/mysql2/README.md b/instrumentation/mysql2/README.md index 66af9c6bb..7ba249e74 100644 --- a/instrumentation/mysql2/README.md +++ b/instrumentation/mysql2/README.md @@ -46,9 +46,9 @@ end ```ruby OpenTelemetry::SDK.configure do |c| c.use 'OpenTelemetry::Instrumentation::Mysql2', { - # The obfuscation of SQL in the db.statement attribute is disabled by default. - # To enable, set db_statement to :obfuscate. - db_statement: :obfuscate, + # The obfuscation of SQL in the db.statement attribute is enabled by default. + # To disable, set db_statement to :include; to omit the query completely, set db_statement to :omit + db_statement: :include, } end ``` diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb index 3e85c3ff3..9a7b78ccb 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb @@ -20,7 +20,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base end option :peer_service, default: nil, validate: :string - option :db_statement, default: :include, validate: %I[omit include obfuscate] + option :db_statement, default: :obfuscate, validate: %I[omit include obfuscate] option :span_name, default: :statement_type, validate: %I[statement_type db_name db_operation_and_name] option :obfuscation_limit, default: 2000, validate: :integer diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb index 8c5258e97..cfc7c95f6 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Mysql2 - VERSION = '0.24.3' + VERSION = '0.25.0' end end end diff --git a/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb b/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb index e363980c7..6eb1ada72 100644 --- a/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb +++ b/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb @@ -22,7 +22,7 @@ let(:instrumentation) { OpenTelemetry::Instrumentation::Mysql2::Instrumentation.instance } let(:exporter) { EXPORTER } let(:span) { exporter.finished_spans.first } - let(:config) { {} } + let(:config) { { db_statement: :include } } before do exporter.reset diff --git a/instrumentation/pg/CHANGELOG.md b/instrumentation/pg/CHANGELOG.md index a85f110f6..f5d811f66 100644 --- a/instrumentation/pg/CHANGELOG.md +++ b/instrumentation/pg/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History: opentelemetry-instrumentation-pg +### v0.26.0 / 2023-10-16 + +* BREAKING CHANGE: Obfuscation for mysql2, dalli and postgresql as default option for db_statement + +* ADDED: Obfuscation for mysql2, dalli and postgresql as default option for db_statement + ### v0.25.3 / 2023-07-29 * FIXED: Pass block explicitly in `define_method` calls for PG instrumentation query methods diff --git a/instrumentation/pg/README.md b/instrumentation/pg/README.md index a9261dce6..12c4c167d 100644 --- a/instrumentation/pg/README.md +++ b/instrumentation/pg/README.md @@ -50,9 +50,9 @@ OpenTelemetry::SDK.configure do |c| # will be included on all spans from this instrumentation: peer_service: 'postgres:readonly', - # By default, this instrumentation includes the executed SQL as the `db.statement` + # By default, this instrumentation obfuscate/sanitize the executed SQL as the `db.statement` # semantic attribute. Optionally, you may disable the inclusion of this attribute entirely by - # setting this option to :omit or sanitize the attribute by setting to :obfuscate + # setting this option to :omit or disbale sanitization the attribute by setting to :include db_statement: :include, } end diff --git a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb index bf6a4dcdc..2eeb6ac66 100644 --- a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb +++ b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb @@ -25,7 +25,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base end option :peer_service, default: nil, validate: :string - option :db_statement, default: :include, validate: %I[omit include obfuscate] + option :db_statement, default: :obfuscate, validate: %I[omit include obfuscate] option :obfuscation_limit, default: 2000, validate: :integer private diff --git a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb index 7e5b54983..35f70e60f 100644 --- a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb +++ b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module PG - VERSION = '0.25.3' + VERSION = '0.26.0' end end end diff --git a/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb b/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb index 57bef4797..32dedf646 100644 --- a/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb +++ b/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb @@ -51,7 +51,7 @@ let(:user) { ENV.fetch('TEST_POSTGRES_USER', 'postgres') } let(:dbname) { ENV.fetch('TEST_POSTGRES_DB', 'postgres') } let(:password) { ENV.fetch('TEST_POSTGRES_PASSWORD', 'postgres') } - + let(:config) { { db_statement: :include } } before do instrumentation.install(config) end diff --git a/instrumentation/rails/Appraisals b/instrumentation/rails/Appraisals index 936cb892f..018ce75b2 100644 --- a/instrumentation/rails/Appraisals +++ b/instrumentation/rails/Appraisals @@ -11,3 +11,7 @@ end appraise 'rails-7.0' do gem 'rails', '~> 7.0.0' end + +appraise 'rails-7.1' do + gem 'rails', '~> 7.1.0' +end diff --git a/instrumentation/rails/CHANGELOG.md b/instrumentation/rails/CHANGELOG.md index 2ff2b00e9..09c338f0f 100644 --- a/instrumentation/rails/CHANGELOG.md +++ b/instrumentation/rails/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-rails +### v0.28.1 / 2023-10-16 + +* FIXED: Add Rails 7.1 compatibility + ### v0.28.0 / 2023-09-07 * FIXED: Align messaging instrumentation operation names diff --git a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb index f5d46002f..a53ef0c6c 100644 --- a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb +++ b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Rails - VERSION = '0.28.0' + VERSION = '0.28.1' end end end diff --git a/resources/azure/opentelemetry-resource-detector-azure.gemspec b/resources/azure/opentelemetry-resource-detector-azure.gemspec index 057091148..0c3d09755 100644 --- a/resources/azure/opentelemetry-resource-detector-azure.gemspec +++ b/resources/azure/opentelemetry-resource-detector-azure.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.55.1' spec.add_development_dependency 'simplecov', '~> 0.17' - spec.add_development_dependency 'webmock', '~> 3.18.1' + spec.add_development_dependency 'webmock', '~> 3.19.1' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec index f5d9a6bec..931751f63 100644 --- a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec +++ b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.55.1' spec.add_development_dependency 'simplecov', '~> 0.17' - spec.add_development_dependency 'webmock', '~> 3.18.1' + spec.add_development_dependency 'webmock', '~> 3.19.1' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata)