Skip to content

Commit

Permalink
Merge branch 'dev' into firehose_instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan authored Jan 2, 2025
2 parents 3605baa + 4e1d3e8 commit 2841dab
Show file tree
Hide file tree
Showing 23 changed files with 181 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .github/versions.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# This file is consumed by lib/tasks/gha.rake
ruby/setup-ruby:
:tag: v1.202.0
:sha: a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc
:tag: v1.204.0
:sha: 401c19e14f474b54450cd3905bb8b86e2c8509cf
actions/checkout:
:tag: v4.1.7
:sha: 692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: '3.3'
- run: bundle
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand All @@ -63,7 +63,7 @@ jobs:
"rails": "norails,rails42,rails52"
},
"3.3.6": {
"rails": "norails,rails61,rails72"
"rails": "norails,rails61,rails72,rails80"
}
}
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -324,7 +324,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -364,7 +364,7 @@ jobs:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: '3.3'
- run: bundle
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: '3.3'
- run: bundle
Expand All @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.0-preview2]
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.0-rc1]

steps:
- name: Configure git
Expand All @@ -50,7 +50,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -79,13 +79,13 @@ jobs:
"rails": "norails,rails61,rails70,rails71,rails72"
},
"3.2.6": {
"rails": "norails,rails61,rails70,rails71,rails72,railsedge"
"rails": "norails,rails61,rails70,rails71,rails72,rails80,railsedge"
},
"3.3.6": {
"rails": "norails,rails61,rails70,rails71,rails72,railsedge"
"rails": "norails,rails61,rails70,rails71,rails72,rails80,railsedge"
},
"3.4.0-preview2": {
"rails": "norails,rails61,rails70,rails71,rails72"
"3.4.0-rc1": {
"rails": "norails,rails61,rails70,rails71,rails72,rails80,railsedge"
}
}
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
fail-fast: false
matrix:
multiverse: [agent, ai, background, background_2, database, kafka, frameworks, httpclients, httpclients_2, rails, rest]
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.0-preview2]
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.0-rc1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
Expand All @@ -243,7 +243,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -308,14 +308,14 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: [2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.0-preview2]
ruby-version: [2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.0-rc1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_jruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install JRuby
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: jruby-9.4.9.0

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install JRuby
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: jruby-9.4.9.0

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci_special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- name: Install OS packages
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby 3.4.0-preview2
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- name: Install Ruby 3.4.0-rc1
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.4.0-preview2
ruby-version: 3.4.0-rc1

- name: Setup bundler
run: ./.github/workflows/scripts/setup_bundler
env:
RUBY_VERSION: 3.4.0-preview2
RUBY_VERSION: 3.4.0-rc1

- name: Run Unit Tests
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/config_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
pull-requests: write
steps:
- name: Install Ruby 3.3
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
with:
ref: 'main'
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: '3.3'
- run: bundle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
pull-requests: write
steps:
- name: Install Ruby 3.3
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
fetch-depth: 0

- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.3
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
pull-requests: write
steps:
- name: Install Ruby 3.3
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/slack_notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
gem_notifications:
runs-on: ubuntu-22.04
steps:
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
cve_notifications:
runs-on: ubuntu-22.04
steps:
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # tag v1.202.0
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # tag v1.204.0
with:
ruby-version: 3.3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ Naming/VariableNumber:
Performance/BindCall:
Enabled: false

# TODO: OLD RUBIES - Requites 2.5
# TODO: OLD RUBIES - Requires 2.5
Performance/DeletePrefix:
Enabled: false

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## dev

- **Feature: Support Ruby 3.4.0**

The agent now supports Ruby 3.4.0. We've made incremental changes throughout the preview stage to reach compatibility. This release includes an update to the Thread Profiler for compatibility with Ruby 3.4.0's new backtrace format. [Issue#2992](https://github.com/newrelic/newrelic-ruby-agent/issues/2992) [PR#2997](https://github.com/newrelic/newrelic-ruby-agent/pull/2997)

- **Feature: Add instrumentation for aws-sdk-firehose**

The agent now has instrumentation for the [aws-sdk-firehose](https://rubygems.org/gems/aws-sdk-firehose) gem. [PR#2973](https://github.com/newrelic/newrelic-ruby-agent/pull/2973)
Expand Down
8 changes: 7 additions & 1 deletion lib/new_relic/agent/instrumentation/resque.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
end

executes do
if NewRelic::Agent.config[:'resque.use_ruby_dns'] && NewRelic::Agent.config[:dispatcher] == :resque
if NewRelic::Agent.config[:'resque.use_ruby_dns'] &&
NewRelic::Agent.config[:dispatcher] == :resque &&
# resolv-replace is no longer part of the language in Ruby 3.4.
# we don't believe this lib is still necessary for Ruby 3.4 users.
# however, if we receive customer feedback to the contrary, we can find
# an alternate approach.
Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.4')
NewRelic::Agent.logger.info('Requiring resolv-replace')
require 'resolv'
require 'resolv-replace'
Expand Down
12 changes: 11 additions & 1 deletion lib/new_relic/agent/local_log_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ def decorating_enabled?
def escape_entity_name(entity_name)
return unless entity_name

URI::DEFAULT_PARSER.escape(entity_name)
# TODO: OLD RUBIES 3.3
# URI version 1.0 marked URI::RFC3986_PARSER.escape as obsolete,
# which URI::DEFAULT_PARSER is an alias for.
# URI version 1.0+ will ship with Ruby 3.4
# Once we drop support for Rubies below 3.4, we can use the
# URI::RFC2396 parser exclusively.
if Gem::Version.new(URI::VERSION) >= Gem::Version.new('1.0')
URI::RFC2396_PARSER.escape(entity_name)
else
URI::DEFAULT_PARSER.escape(entity_name)
end
end
end
end
Expand Down
11 changes: 10 additions & 1 deletion lib/new_relic/agent/threading/backtrace_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,16 @@ def dump_string(indent = 0)

# Returns [filename, method, line number]
def parse_backtrace_frame(frame)
frame =~ /([^:]*)(\:(\d+))?\:in `(.*)'/
# TODO: OLD RUBIES - Ruby 3.3
# The (?:`|') non-capturing group can be removed when the agent
# drops support for Ruby 3.3
# This group is used to capture the pre-Ruby 3.4.0 backtrace syntax.
# Example frame:
# Ruby 3.3.0 and below
# "irb.rb:69:in `catch'"
# Ruby 3.4.0+
# "irb.rb:69:in 'Kernel#catch'"
frame =~ /([^:]*)(\:(\d+))?\:in (?:`|')(.*)'/
[$1, $4, $3] # sic
end
end
Expand Down
9 changes: 0 additions & 9 deletions test/multiverse/suites/config_file_loading/Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ def stringio_version
end
end

def date_version
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4')
"gem 'date', '~> 3.3.4'"
else
"gem 'date'"
end
end

def gem_list(psych_version = nil)
<<~RB
#{stringio_version}
#{date_version}
# stub file system so we can test that newrelic.yml can be loaded from
# various places.
gem 'fakefs', :require => false
Expand Down
7 changes: 2 additions & 5 deletions test/multiverse/suites/rails/Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ def haml_rails(rails_version = nil)
rails_version.include?('4.0.13') ||
rails_version.include?('4.1.16') ||
rails_version.include?('4.2.11') ||
rails_version.include?('5.0.7') ||
rails_version.include?('5.1.7') ||
rails_version.include?('5.2.8'))
"gem 'haml-rails', '~> 1.0.0'"
rails_version.include?('5.0.7'))
"gem 'haml-rails', '~> 1.0'\ngem 'haml', '~> 5.1'\ngem 'tilt', '~> 2.4.0'"
else
"gem 'haml-rails', '~> 2.0'"
end
Expand All @@ -43,7 +41,6 @@ end
def gem_list(rails_version = nil)
<<-RB
gem 'rails'#{rails_version}
gem 'haml', '5.1.2'
#{haml_rails(rails_version)}
gem 'minitest', '#{minitest_rails_version(rails_version)}'
gem 'erubis' if RUBY_PLATFORM.eql?('java')
Expand Down
2 changes: 1 addition & 1 deletion test/multiverse/suites/rails_prepend/Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def gem_list(rails_version = nil)
minitest_version = rails_version && rails_version.include?('4.0') ? '4.2.0' : '5.2.3'
<<~RB
gem 'rails'#{rails_version}
gem 'haml'
gem 'haml', '~> 6.0'
gem 'newrelic_prepender', path: File.expand_path('../newrelic_prepender', __FILE__)
gem 'minitest', '~> #{minitest_version}'
gem 'erubis', '~> 2.7.0' if RUBY_PLATFORM.eql?('java')
Expand Down
4 changes: 1 addition & 3 deletions test/multiverse/suites/resque/Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@

RESQUE_VERSIONS = [
[nil],
['2.2.0', 2.4],
['2.2.0'],
['1.27.0']
]

def gem_list(resque_version = nil)
<<~RB
gem 'resque'#{resque_version}
#{"gem 'rackup'" if RUBY_VERSION >= '2.7.8'}


RB
end

Expand Down
Loading

0 comments on commit 2841dab

Please sign in to comment.