Skip to content
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

Release 9.14.0 #2867

Merged
merged 108 commits into from
Sep 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
78857ad
add rdkafka instrumentation
tannalynn Aug 7, 2024
886cdc3
add extra metrics
tannalynn Aug 8, 2024
26a2f81
add tests
tannalynn Aug 21, 2024
1d9d9e7
update tests
tannalynn Aug 21, 2024
f9be41b
add GHA service for kafka
tannalynn Aug 21, 2024
65d5414
Merge branch 'dev' into add_kafka_instrumentation
tannalynn Aug 21, 2024
0cf1d24
fix spacing in ci.yml
tannalynn Aug 21, 2024
d3ee9d9
rubocop angry
tannalynn Aug 21, 2024
0996791
remove commented out code and only run prepend for now
tannalynn Aug 21, 2024
b26db50
change listener name
tannalynn Aug 21, 2024
c008d95
try new env variables
tannalynn Aug 21, 2024
cefdb72
remove commented out env vars
tannalynn Aug 21, 2024
0db8f83
still call old version when using old CAT
tannalynn Aug 21, 2024
bcaa0b9
add kafka service to cron ci
tannalynn Aug 21, 2024
d44fc06
do both old one and new one
tannalynn Aug 21, 2024
1ea27bf
update SQL obfuscation regexes
fallwith Aug 21, 2024
d5b7cd7
limit ruby versions for test
tannalynn Aug 21, 2024
ec1c79a
add chain instrumentation
tannalynn Aug 21, 2024
dde87b1
make it work with older kafka versions
tannalynn Aug 22, 2024
ee940ad
rubocop
tannalynn Aug 22, 2024
f52216b
try changing rubygems version
tannalynn Aug 22, 2024
b096040
limit to 2.5+
tannalynn Aug 22, 2024
9dab09e
limit ffi version
tannalynn Aug 22, 2024
8143656
remove unused helper method
tannalynn Aug 22, 2024
e80579c
remove comment
tannalynn Aug 22, 2024
e109579
Merge branch 'dev' into add_kafka_instrumentation
tannalynn Aug 23, 2024
935e559
add changelog entry
tannalynn Aug 23, 2024
c1d8d64
remove todo
tannalynn Aug 23, 2024
5beb294
Merge pull request #2826 from newrelic/0b4u5c@t10n
fallwith Aug 23, 2024
92030d3
CI: Healthy URL checker tweaks
fallwith Aug 24, 2024
992426d
Merge pull request #2829 from newrelic/Mi_Amor,_Mi_Vampira
fallwith Aug 26, 2024
5ca88b7
add instrumentation metric
tannalynn Aug 27, 2024
f91e1de
add karafka rdkafka to envfile
tannalynn Aug 29, 2024
bcc6de6
comment out ARN attr until it is decided how we want to handle gettin…
tannalynn Aug 29, 2024
9f734fe
comment out ARN test assertion
tannalynn Aug 29, 2024
de2914b
Merge pull request #2824 from newrelic/add_kafka_instrumentation
tannalynn Aug 29, 2024
ef2c632
Merge pull request #2834 from newrelic/comment_out_dynamo_db_arn
tannalynn Aug 29, 2024
2b3949c
add test for Sidekiq's perform_inline
fallwith Aug 30, 2024
9eea9df
Sidekiq inline test: use Sidekiq v7+
fallwith Aug 30, 2024
41430b2
Merge pull request #2836 from newrelic/sidekiq_inline
fallwith Sep 3, 2024
5bdb8b9
CI: update to Ruby v3.3.5
fallwith Sep 4, 2024
f22056b
Merge pull request #2837 from newrelic/335
fallwith Sep 4, 2024
d19d729
Add rdkafka gem to Slack Notifications
kaylareopelle Sep 5, 2024
b9c118e
Kafka instrumentation: code loading logic fix
fallwith Sep 6, 2024
c88aa67
Merge pull request #2841 from newrelic/die_verwandlung
fallwith Sep 6, 2024
01b8140
Merge pull request #2839 from newrelic/add-rdkafka-to-notifications
kaylareopelle Sep 6, 2024
dcc965e
adding instrumentation
tannalynn Sep 9, 2024
70a0d1a
add prepend instrumentation
tannalynn Sep 9, 2024
bb7f67e
add tests
tannalynn Sep 9, 2024
61ff012
do chain instrumentation
tannalynn Sep 9, 2024
3097935
add debug logging for kafka tests
tannalynn Sep 10, 2024
0e379d1
add require
tannalynn Sep 10, 2024
6ee6722
remove debugging logger
tannalynn Sep 10, 2024
53bb5b0
remove comments
tannalynn Sep 10, 2024
7f495c4
Merge branch 'dev' into ruby_kafka_gem_instrumentation
tannalynn Sep 10, 2024
7102016
update changelog
tannalynn Sep 10, 2024
5489342
update changelog
tannalynn Sep 10, 2024
6490a22
Update CHANGELOG.md
tannalynn Sep 11, 2024
47540d5
Update CHANGELOG.md
tannalynn Sep 11, 2024
e3a4d93
Update CHANGELOG.md
tannalynn Sep 11, 2024
14b23d2
add suite condition for CI to not run on new ruby versions because ge…
tannalynn Sep 11, 2024
e97cf55
Merge branch 'ruby_kafka_gem_instrumentation' of github.com:newrelic/…
tannalynn Sep 11, 2024
a63dfbd
fix jruby config bug
tannalynn Sep 11, 2024
65dfe18
add changelog entry
tannalynn Sep 11, 2024
978b3c6
fix for rdkafka on load tests
tannalynn Sep 11, 2024
d121224
Merge pull request #2848 from newrelic/bugfix_jruby_config
tannalynn Sep 11, 2024
51039bf
Merge branch 'dev' into ruby_kafka_gem_instrumentation
tannalynn Sep 11, 2024
9028e3f
Update test/multiverse/suites/ruby_kafka/Envfile
tannalynn Sep 11, 2024
b3f45e4
Merge pull request #2849 from newrelic/fix_load_tests
fallwith Sep 11, 2024
a514d91
unit tests: scope to files, favor the shortest
fallwith Sep 12, 2024
07d27ce
Merge pull request #2850 from newrelic/kluia.co
fallwith Sep 12, 2024
de9aa58
Apply method tracers automatically via config
fallwith Sep 14, 2024
e829bad
unit test fixes for automatic method tracers
fallwith Sep 16, 2024
4df5d1f
Merge pull request #2842 from newrelic/ruby_kafka_gem_instrumentation
fallwith Sep 16, 2024
89231b7
Merge branch 'dev' into automatic_for_the_people
fallwith Sep 16, 2024
2962690
CHANGELOG entry for automatic custom instrumentation
fallwith Sep 16, 2024
e1ec637
Update CHANGELOG.md
fallwith Sep 16, 2024
6425875
Update CHANGELOG.md
fallwith Sep 16, 2024
3b84ee0
Update lib/new_relic/agent/configuration/default_source.rb
fallwith Sep 16, 2024
3925b29
Update lib/new_relic/agent/configuration/default_source.rb
fallwith Sep 16, 2024
2702347
indentation fix for code block for PR 2851
fallwith Sep 16, 2024
87589d7
mark new agent class methods as private
fallwith Sep 16, 2024
c71c1e3
Merge pull request #2851 from newrelic/automatic_for_the_people
fallwith Sep 18, 2024
701c5fc
Update min bundler version for installed_specs?
kaylareopelle Sep 18, 2024
dccb490
Merge branch 'dev' into update-bundled-gem-version-condition
kaylareopelle Sep 18, 2024
97e3a79
Add changelog
kaylareopelle Sep 18, 2024
bf466ef
Replace version checks with respond_to?
kaylareopelle Sep 18, 2024
29eb94a
Lockdown Boolean configs (#2847)
hannahramadan Sep 19, 2024
ccd055b
Update CHANGELOG.md
kaylareopelle Sep 20, 2024
768eb6d
Merge pull request #2853 from newrelic/update-bundled-gem-version-con…
kaylareopelle Sep 20, 2024
e8d4356
Rails edge now requires sqlite3 2.1+
kaylareopelle Sep 25, 2024
2dfd223
Use `media_type` instead of `content_type` when avaliable (#2855)
hannahramadan Sep 25, 2024
44c89d9
Add boolean update to CHANGELOG summary (#2864)
hannahramadan Sep 25, 2024
4a4c3a6
Merge pull request #2863 from newrelic/rails-edge-sqlite3-update
kaylareopelle Sep 25, 2024
56ab32e
bump version
newrelic-ruby-agent-bot Sep 25, 2024
48b1d7c
Update newrelic.yml
kaylareopelle Sep 25, 2024
9f62edf
Merge pull request #2865 from newrelic/prerelease_updates_9.14.0-pre
kaylareopelle Sep 25, 2024
44bcb74
Update changelog for 9.14.0 release
kaylareopelle Sep 25, 2024
2897f32
Merge pull request #2868 from newrelic/changelog-tweaks-914
kaylareopelle Sep 26, 2024
df71498
Safety check in instrumentation render_in_with_tracing that identifie…
navidemad Sep 28, 2024
9587e77
Remove railsedge testing from Ruby 3.1
kaylareopelle Sep 30, 2024
485b1f2
Update Envfiles for Rails 8.0
kaylareopelle Sep 30, 2024
bbfdb8e
Update min version in unshift_rails_edge
kaylareopelle Sep 30, 2024
d3bd85e
Merge pull request #2871 from newrelic/railsedge-31
kaylareopelle Sep 30, 2024
3063ea8
Merge pull request #2870 from navidemad/dev
fallwith Sep 30, 2024
72d32e9
unit test and CHANGELOG entry for 2870
fallwith Sep 30, 2024
ad5f9b8
add ViewComponent fix mention to the v9.14.0 summary
fallwith Sep 30, 2024
8fc3ea6
Merge pull request #2873 from newrelic/2870_test_and_changelog_entry
fallwith Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use media_type instead of content_type when avaliable (#2855)
* Use media_type to collect MIME type for Rails 7.1+
hannahramadan authored Sep 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2dfd22356d42a8d57e443077106363b803115395
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

## dev

Version <dev> adds Apache Kafka instrumentation for the rdkafka and ruby-kafka gems, introduces a configuration-based, automatic way to add custom instrumentation method tracers, fixes a JRuby bug in the configuration manager, and fixes a bug related to `Bundler.rubygems.installed_specs`.
Version <dev> adds Apache Kafka instrumentation for the rdkafka and ruby-kafka gems, introduces a configuration-based, automatic way to add custom instrumentation method tracers, correctly captures MIME type for AcionDispatch 7.0+ requests, fixes a JRuby bug in the configuration manager, and fixes a bug related to `Bundler.rubygems.installed_specs`.

- **Feature: Add Apache Kafka instrumentation for the rdkafka and ruby-kafka gems**

@@ -56,6 +56,10 @@ Version <dev> adds Apache Kafka instrumentation for the rdkafka and ruby-kafka g

[PR#2851](https://github.com/newrelic/newrelic-ruby-agent/pull/2851)

- **Feature: Collect just MIME type for AcionDispatch 7.0+ requests**

Rails 7.0 [introduced changes](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#actiondispatch-request-content-type-now-returns-content-type-header-as-it-is) to the behavior of `ActionDispatch::Request#content_type`, adding extra request-related details the agent wasn't expecting to collect. Additionally, the agent's use of `content_type ` was triggering deprecation warnings. The agent now uses `ActionDispatch::Request#media_type` to capture the MIME type. Thanks to [@internethostage](https://github.com/internethostage) for letting us know about this change. [Issue#2500](https://github.com/newrelic/newrelic-ruby-agent/issues/2500) [PR#2855](https://github.com/newrelic/newrelic-ruby-agent/pull/2855)

- **Bugfix: Corrected Boolean coercion for `newrelic.yml` configuration**

Previously, any String assigned to New Relic configurations expecting a Boolean value were evaluated as `true`. This could lead to unexpected behavior. For example, setting `application_logging.enabled: 'false'` in `newrelic.yml` would incorrectly evaluate to `application_logging.enabled: true` due to the truthy nature of Strings.
14 changes: 13 additions & 1 deletion lib/new_relic/agent/transaction/request_attributes.rb
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ def initialize(request)
@referer = referer_from_request(request)
@accept = attribute_from_env(request, HTTP_ACCEPT_HEADER_KEY)
@content_length = content_length_from_request(request)
@content_type = attribute_from_request(request, :content_type)
@content_type = content_type_attribute_from_request(request)
@host = attribute_from_request(request, :host)
@port = port_from_request(request)
@user_agent = attribute_from_request(request, :user_agent)
@@ -127,6 +127,18 @@ def attribute_from_request(request, attribute_method)
end
end

def content_type_attribute_from_request(request)
# Rails 7.0 changed the behavior of `content_type`. We want just the MIME type, so use `media_type` if available.
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#actiondispatch-request-content-type-now-returns-content-type-header-as-it-is
content_type = if request.respond_to?(:media_type)
:media_type
elsif request.respond_to?(:content_type)
:content_type
end

request.send(content_type) if content_type
end

def attribute_from_env(request, key)
if env = attribute_from_request(request, :env)
env[key]
31 changes: 30 additions & 1 deletion test/new_relic/agent/transaction/request_attributes_test.rb
Original file line number Diff line number Diff line change
@@ -127,13 +127,42 @@ def test_sets_content_length_from_request
assert_equal 111, attrs.content_length
end

def test_sets_content_type_from_request
def test_sets_content_type_from_request_content_type_attribute
request = stub('request', :content_type => 'application/json')
attrs = RequestAttributes.new(request)

assert_equal 'application/json', attrs.content_type
end

def test_sets_content_type_from_request_media_type_attribute
media_type = 'pool-party/alligator'
request = stub('request', media_type: media_type)
attrs = RequestAttributes.new(request)

assert_equal media_type, attrs.content_type
end

def test_sets_content_type_to_nil_if_media_type_is_available_with_a_nil_value
request = stub('request', media_type: nil)
attrs = RequestAttributes.new(request)

assert_nil attrs.content_type
end

def test_sets_content_type_to_nil_if_content_type_is_available_with_a_nil_value
request = stub('request', content_type: nil)
attrs = RequestAttributes.new(request)

assert_nil attrs.content_type
end

def test_sets_content_type_to_nil_if_neither_media_type_or_content_type_are_available
request = stub('request')
attrs = RequestAttributes.new(request)

assert_nil attrs.content_type
end

def test_sets_host_from_request
request = stub('request', :host => 'localhost')
attrs = RequestAttributes.new(request)