Skip to content

Commit

Permalink
chore: Merge upstream changes (#8)
Browse files Browse the repository at this point in the history
* added httpx opentelemetry adapter (open-telemetry#681)

* added httpx opentelemetry adapter

* Update instrumentation/httpx/CHANGELOG.md

Co-authored-by: Ariel Valentin <[email protected]>

* Update instrumentation/httpx/README.md

Co-authored-by: Ariel Valentin <[email protected]>

* Update instrumentation/httpx/README.md

Co-authored-by: Ariel Valentin <[email protected]>

---------

Co-authored-by: Ariel Valentin <[email protected]>
Co-authored-by: Josef Šimánek <[email protected]>

* chore: Change release restrictions

The toys gem checks that all actions are passing before allowing
a release request to be opened, however only the CI builds are actually required.

This change limits the release request requirements to look specifically for CI builds

* chore: Fix httpx version

* chore: bump toys

* release: Release opentelemetry-instrumentation-httpx 0.1.0 (initial release) (open-telemetry#713)

* release: Release opentelemetry-instrumentation-httpx 0.1.0 (initial release)

* Update instrumentation/httpx/CHANGELOG.md

* feat!: Drop Rails 6.0 EOL (open-telemetry#680)

* feat!: Drop Rails 6.0 EOL

6.0 is no longer receiving maintenance, security, or feature updates as of 01 Jun 2023

Users who want to continue instrumentating Rails applications should pin to earlier versions of the instrumentation.

* squash: Fix test

* squash: gem version object instead of string

* Update README.md

Co-authored-by: Kayla Reopelle (she/her) <[email protected]>

* Update instrumentation/README.md

Co-authored-by: Kayla Reopelle (she/her) <[email protected]>

---------

Co-authored-by: Kayla Reopelle (she/her) <[email protected]>

* Inline gemspec dev constraints with Appraisals. (open-telemetry#716)

* Removal Sinatra 1.x Appraisal (open-telemetry#715)

fix: Removal Sinatra 1.x Appraisal

Rack 1.x is not directly supported anymore. Sinatra 1.x in turn
"is not". Removal appraisal and add a compatibility note to both
Sinatra and Rack for proper instrumentation version usage.

Co-authored-by: Ariel Valentin <[email protected]>

---------

Co-authored-by: Tiago <[email protected]>
Co-authored-by: Ariel Valentin <[email protected]>
Co-authored-by: Josef Šimánek <[email protected]>
Co-authored-by: Ariel Valentin <[email protected]>
Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
Co-authored-by: Zachery Hostens <[email protected]>
  • Loading branch information
7 people authored Nov 21, 2023
1 parent 5d4b7d8 commit 991b18b
Show file tree
Hide file tree
Showing 62 changed files with 872 additions and 90 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-instrumentation-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- koala
- lmdb
- net_http
- httpx
- rack
- rails
- restclient
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-instrumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- gruf
- http
- http_client
- httpx
- koala
- lmdb
- net_http
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Toys
run: "gem install --no-document toys -v 0.15.1"
run: "gem install --no-document toys -v 0.15.3"
- name: Process release request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Toys
run: "gem install --no-document toys -v 0.15.1"
run: "gem install --no-document toys -v 0.15.3"
- name: Update open releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Toys
run: "gem install --no-document toys -v 0.15.1"
run: "gem install --no-document toys -v 0.15.3"
- name: Perform release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Toys
run: "gem install --no-document toys -v 0.15.1"
run: "gem install --no-document toys -v 0.15.3"
- name: Open release pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Toys
run: "gem install --no-document toys -v 0.15.1"
run: "gem install --no-document toys -v 0.15.3"
- name: Retry release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 5 additions & 0 deletions .toys/.data/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repo: open-telemetry/opentelemetry-ruby-contrib
main_branch: main
# Time in seconds for release scripts to wait for CI to complete.
required_checks_timeout: 1200
required_jobs: "^(ci|CI).*"
# Git user attached to commits for release pull requests.
git_user_name: Ariel Valentin
git_user_email: [email protected]
Expand Down Expand Up @@ -106,6 +107,10 @@ gems:
directory: instrumentation/http_client
version_constant: [OpenTelemetry, Instrumentation, HttpClient, VERSION]

- name: opentelemetry-instrumentation-httpx
directory: instrumentation/httpx
version_constant: [OpenTelemetry, Instrumentation, HTTPX, VERSION]

- name: opentelemetry-instrumentation-koala
directory: instrumentation/koala
version_constant: [OpenTelemetry, Instrumentation, Koala, VERSION]
Expand Down
4 changes: 2 additions & 2 deletions .toys/.toys.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
toys_version! "0.15.1"
toys_version! "0.15.3"

load_git remote: "https://github.com/dazuma/toys.git",
path: ".toys/release",
as: "release",
commit: "toys/v0.15.1",
commit: "toys/v0.15.3",
update: 3600
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ This repository also contains libraries to aid with interoperablity with vendor

OpenTelemetry Ruby follows the [versioning and stability document][otel-versioning] in the OpenTelemetry specification. Notably, we adhere to the outlined version numbering exception, which states that experimental signals may have a `0.x` version number.

### Library Compatability

This project is managed on a volunteer basis and therefore we have limited capacity to support compatability with unmaintained or EOL libraries.

We will regularly review the instrumentations to drop compatability for any versions of Ruby or gems that reach EOL or no longer receive regular maintenance.

Should you need instrumentation for _older_ versions of a library then you must pin to a specific version of the instrumentation that supports it,
however, you will no longer receive any updates for the instrumentation from this repository.

> When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. We may provide backports of the fixes and publish them to git, however there will be no new versions released. If you are not comfortable maintaining your own versions, you should upgrade to a supported version. <https://guides.rubyonrails.org/maintenance_policy.html#security-issues>
Consult instrumentation gem's README file and gemspec for details about library compatability.

### Releases

This repository was extracted from the [OpenTelemetry Ruby repository][otel-ruby]. Versions of libraries contained in this repo released prior to 2022-06-13 are available on the [OpenTelemetry Ruby Releases][otel-ruby-releases] page. Newer versions are available [here][otel-ruby-contrib-releases]
Expand Down
9 changes: 9 additions & 0 deletions instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ Instrumentation-specific documentation can be found in each subdirectory's `READ

You also have the option of installing all of the instrumentation libraries by installing `opentelemetry-instrumentation-all`. See that gem's [README](https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/all) for more.

### Maintenance and Version Compatability

We are a community of volunteers who do our best to provide our users with up to date support for instrumentations,
however we have limited capacity and are unable to support compatability with EOL or unmaintained libraries.

Should you need to instrument an _older_ version of a library you will have to ensure to pin to an instrumentation version that is compatible with that library.

Please review the individual instrumentation READMEs for more information about version compatability.

## How can I get involved?

The source for all OpenTelemetry Ruby instrumentation gems is [on github](https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation).
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/action_pack/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActionPack
# The Instrumentation class contains logic to detect and install the ActionPack instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.0.0')
MINIMUM_VERSION = Gem::Version.new('6.1.0')

install do |_config|
require_railtie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rails', '>= 6'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.56.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
Expand Down
9 changes: 0 additions & 9 deletions instrumentation/action_pack/test/test_helpers/app_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def initialize_app(use_exceptions_app: false, remove_rack_tracer_middleware: fal
new_app.config.filter_parameters = [:param_to_be_filtered]

case Rails.version
when /^6\.0/
apply_rails_6_0_configs(new_app)
when /^6\.1/
apply_rails_6_1_configs(new_app)
when /^7\./
Expand Down Expand Up @@ -73,13 +71,6 @@ def add_middlewares(application)
)
end

def apply_rails_6_0_configs(application)
# Required in Rails 6
application.config.hosts << 'example.org'
# Creates a lot of deprecation warnings on subsequent app initializations if not explicitly set.
application.config.action_view.finalize_compiled_template_methods = ActionView::Railtie::NULL_OPTION
end

def apply_rails_6_1_configs(application)
# Required in Rails 6
application.config.hosts << 'example.org'
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/action_view/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActionView
# The Instrumentation class contains logic to detect and install the ActionView instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.0.0')
MINIMUM_VERSION = Gem::Version.new('6.1.0')
install do |_config|
require_dependencies
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rails', '>= 6'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.56.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/active_job/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

%w[6.0.0 6.1.0 7.0.0 7.1.0].each do |version|
%w[6.1.0 7.0.0 7.1.0].each do |version|
appraise "activejob-#{version}" do
gem 'activejob', "~> #{version}"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActiveJob
# The Instrumentation class contains logic to detect and install the ActiveJob instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.0.0')
MINIMUM_VERSION = Gem::Version.new('6.1.0')

install do |_config|
require_dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'

spec.add_development_dependency 'activejob', '>= 6.0.0'
spec.add_development_dependency 'activejob', '>= 6.1'
spec.add_development_dependency 'appraisal', '~> 2.5'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'minitest', '~> 5.0'
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/active_record/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'activerecord-6.0' do
gem 'activerecord', '~> 6.0.0'
end

appraise 'activerecord-6.1' do
gem 'activerecord', '~> 6.1.0'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ module Instrumentation
module ActiveRecord
# The Instrumentation class contains logic to detect and install the ActiveRecord instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.0.0')
MAX_MAJOR_VERSION = 7
MINIMUM_VERSION = Gem::Version.new('6.1.0')

install do |_config|
require_dependencies
Expand All @@ -22,11 +21,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
end

compatible do
# We know that releases after MAX_MAJOR_VERSION are unstable so we
# check the major version number of the gem installed to make sure we
# do not install on a pre-release or full release of the latest
# if it exceeds the MAX_MAJOR_VERSION version.
gem_version >= MINIMUM_VERSION && gem_version.segments[0] <= MAX_MAJOR_VERSION
gem_version >= MINIMUM_VERSION
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
spec.add_dependency 'ruby2_keywords'

spec.add_development_dependency 'activerecord'
spec.add_development_dependency 'activerecord', '>= 6.1'
spec.add_development_dependency 'appraisal', '~> 2.5'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'minitest', '~> 5.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@
end
end

it 'when a version above the maximum supported gem version is installed' do
ActiveRecord.stub(:version, Gem::Version.new('8.0.0')) do
_(instrumentation.compatible?).must_equal false
end
end

it 'it treats pre releases as being equivalent to a full release' do
ActiveRecord.stub(:version, Gem::Version.new('8.0.0.alpha')) do
_(instrumentation.compatible?).must_equal false
end
end

it 'when supported gem version installed' do
_(instrumentation.compatible?).must_equal true
end
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/active_support/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'activesupport-6.0' do
gem 'activesupport', '~> 6.0.0'
end

appraise 'activesupport-6.1' do
gem 'activesupport', '~> 6.1.0'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module Instrumentation
module ActiveSupport
# The Instrumentation class contains logic to detect and install the ActiveSupport instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')

install do |_config|
require_dependencies
end
Expand All @@ -17,8 +19,16 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
defined?(::ActiveSupport)
end

compatible do
gem_version >= MINIMUM_VERSION
end

private

def gem_version
::ActiveSupport.version
end

def require_dependencies
require_relative 'span_subscriber'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'pry-byebug'
spec.add_development_dependency 'rails', '>= 6'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.56.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +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 'concurrent-ruby', '~> 1.1.6'
spec.add_development_dependency 'concurrent-ruby', '~> 1.0'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'appraisal', '~> 2.5'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'ethon', '~> 0.12.0'
spec.add_development_dependency 'ethon', '~> 0.11'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'appraisal', '~> 2.5'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'faraday', '~> 0.17.0'
spec.add_development_dependency 'faraday'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
Expand Down
9 changes: 9 additions & 0 deletions instrumentation/httpx/.yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--no-private
--title=OpenTelemetry HTTPX Instrumentation
--markup=markdown
--main=README.md
./lib/opentelemetry/instrumentation/**/*.rb
./lib/opentelemetry/instrumentation.rb
-
README.md
CHANGELOG.md
13 changes: 13 additions & 0 deletions instrumentation/httpx/Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

appraise 'httpx-1' do
gem 'httpx', '~> 1.0'
end

appraise 'httpx-0' do
gem 'httpx', '~> 0.24'
end
5 changes: 5 additions & 0 deletions instrumentation/httpx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History: opentelemetry-instrumentation-httpx

### v0.1.0 / 2023-11-06

* Initial Release.
Loading

0 comments on commit 991b18b

Please sign in to comment.