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

v9.1.0 #1914

Merged
merged 177 commits into from
Mar 29, 2023
Merged

v9.1.0 #1914

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
54b176c
CI: test with JRuby 9.4.1.0
fallwith Feb 7, 2023
d8c7ad0
CI: retry 1 for JRuby
fallwith Feb 8, 2023
834d149
remove unused code
fallwith Feb 8, 2023
2ee793c
Merge branch 'dev' into jruby9410
fallwith Feb 15, 2023
0269a8b
only accept DT headers if not nil
tannalynn Feb 22, 2023
bfd98be
Add test
tannalynn Feb 23, 2023
cb52197
add changelog entry
tannalynn Feb 23, 2023
011af03
Update CHANGELOG.md
tannalynn Feb 23, 2023
3a2d8eb
Update CHANGELOG.md
fallwith Feb 23, 2023
305a494
Merge pull request #1834 from newrelic/sidekiq_dt_warnings
fallwith Feb 23, 2023
d36f993
CAT: do not insert headers for gRPC requests
fallwith Feb 24, 2023
b82913a
Update typhoeus multiverse suite_condition
kaylareopelle Feb 24, 2023
45a43b5
Merge pull request #1838 from newrelic/typheous-suite-condition
kaylareopelle Feb 24, 2023
7ed7557
Update test/multiverse/suites/agent_only/cross_application_tracing_te…
fallwith Feb 24, 2023
a283671
Add headers method to AbstractRequest subclasses
kaylareopelle Feb 24, 2023
36846d3
Print header hash in log message
kaylareopelle Feb 24, 2023
f587197
Add CHANGELOG entry
kaylareopelle Feb 24, 2023
516763f
Make header assertion case insensitive
kaylareopelle Feb 24, 2023
b0a4177
Enable Performance/RegexpMatch rubocop
kaylareopelle Feb 24, 2023
02b7aab
Enable Performance/Sum
kaylareopelle Feb 24, 2023
92a0128
Enable Performance/UnfreezeString
kaylareopelle Feb 24, 2023
8e4f3d8
Disable Style/FetchEnvVar
kaylareopelle Feb 24, 2023
389e9f1
Resolve cop duplication
kaylareopelle Feb 24, 2023
12259d4
Enable Style/RedundantStringEscape
kaylareopelle Feb 24, 2023
d8cd1b5
Remove Style/FetchEnvVar from rubocop_todo
kaylareopelle Feb 24, 2023
0b28bf7
Refactor AbstractRequest class
kaylareopelle Feb 24, 2023
edd3378
Add argument to not_implemented and :uri to array
kaylareopelle Feb 24, 2023
26e4415
gRPC and CAT: move the CAT check to gRPC client
fallwith Feb 24, 2023
3332e9f
Enable Style/SafeNavigation
kaylareopelle Feb 24, 2023
c80cdfb
gRPC client tests: comment all tests back in
fallwith Feb 24, 2023
236788a
Fix define_method strategy
kaylareopelle Feb 24, 2023
36d1257
Multiverse: always show options, fix 'not found'
fallwith Feb 25, 2023
03d82e6
Remove references to some cops enabled by default
kaylareopelle Feb 25, 2023
74358ac
Remove interpolation of name
kaylareopelle Feb 25, 2023
a243a4d
Use %i for symbol array generation
kaylareopelle Feb 25, 2023
e524580
Merge pull request #1841 from newrelic/1985_toyota_hilux_pickup_deluxe
fallwith Feb 25, 2023
0c1ced4
Merge pull request #1837 from newrelic/while_the_cat-s_among_the_pige…
fallwith Feb 25, 2023
6845f7a
Merge pull request #1839 from newrelic/log-request-headers
kaylareopelle Feb 25, 2023
8238feb
Fix missing space in warning
henrik Feb 27, 2023
0f233e4
make sure class can respond to
tannalynn Feb 27, 2023
5e834b9
add changelog entry
tannalynn Feb 27, 2023
09990c1
Merge pull request #1843 from henrik/patch-1
tannalynn Feb 27, 2023
93f78f3
update changelog wording
tannalynn Feb 27, 2023
8551bcf
add test
tannalynn Feb 27, 2023
e0bbbbf
Update lib/new_relic/agent/instrumentation/action_controller_other_su…
tannalynn Feb 27, 2023
f2db946
Update CHANGELOG.md
tannalynn Feb 27, 2023
1ff2436
Disable Style/SafeNavigation in untested locations
kaylareopelle Feb 28, 2023
bc3af6e
Merge pull request #1844 from newrelic/bugfix/action_controller_contr…
tannalynn Feb 28, 2023
0752b83
Rubocop
kaylareopelle Feb 28, 2023
ffd61c5
RuboCop: address some AbcSize issues
fallwith Mar 1, 2023
054c25b
Merge branch 'dev' into rubocop-ruby24-compat
kaylareopelle Mar 1, 2023
45e1718
PR feedback
kaylareopelle Mar 1, 2023
09df6ba
Merge branch 'rubocop-ruby24-compat' of github.com:newrelic/newrelic-…
kaylareopelle Mar 1, 2023
d8107d4
Merge pull request #1840 from newrelic/rubocop-ruby24-compat
kaylareopelle Mar 1, 2023
a6d1cec
browser monitoring: refactoring fix
fallwith Mar 1, 2023
56f45fe
Merge branch 'dev' into the_last_paperback_found_in_the_back_of_the_l…
fallwith Mar 1, 2023
3666602
browser monitoring: don't pass unused param
fallwith Mar 2, 2023
ce4e64c
Merge pull request #1849 from newrelic/the_last_paperback_found_in_th…
fallwith Mar 2, 2023
dfadcfd
Style: align with RuboCop defaults for quotes
fallwith Mar 3, 2023
7aebf52
Merge pull request #1853 from newrelic/how_many
fallwith Mar 3, 2023
f37e879
RuboCop AbcSize driven updates:
fallwith Mar 3, 2023
68a3405
Merge pull request #1854 from newrelic/smurf_in_a_hammock
fallwith Mar 4, 2023
3232df0
update typhoeus suite condition
tannalynn Mar 6, 2023
8f6ff7e
Merge pull request #1855 from newrelic/jruby_typhoeus_failure
tannalynn Mar 6, 2023
d1487d4
Use !value.nil? instead of nil != value
kaylareopelle Mar 6, 2023
a41efe3
add set_user_id api method
tannalynn Mar 6, 2023
4fbd9e0
fix warnings in unit tests
tannalynn Mar 6, 2023
288b2d6
errors inbox fingerprinting WIP
fallwith Mar 7, 2023
14c4617
remove leftover debug statement
fallwith Mar 7, 2023
4f4b507
update test regex to use %r{}
tannalynn Mar 7, 2023
e4657bf
error fingerprinting: log message, typo fix
fallwith Mar 7, 2023
9bb144c
add test for user id
tannalynn Mar 7, 2023
df8a734
remove unneeded call to reset_error_traces
tannalynn Mar 7, 2023
99298ee
use test_user_id variable for user id
tannalynn Mar 7, 2023
288bee4
error fingerprinting WIP 2
fallwith Mar 8, 2023
445ac10
Merge pull request #1857 from newrelic/fix_test_warnings
tannalynn Mar 8, 2023
cedd02d
Replace markdown header with HTML snippet
kaylareopelle Mar 8, 2023
78c3d99
Update lib/new_relic/agent.rb
tannalynn Mar 8, 2023
9781aaf
Merge pull request #1869 from newrelic/repolinter
kaylareopelle Mar 8, 2023
46e674c
Merge pull request #1856 from newrelic/perf-nil-update
kaylareopelle Mar 8, 2023
589d9c1
Replace !! with !value.nil? or other equivalent
kaylareopelle Mar 8, 2023
0137791
Merge pull request #1870 from newrelic/rubocop-double-negate
kaylareopelle Mar 8, 2023
fe94af0
error fingerprinting
fallwith Mar 8, 2023
3d588a7
Update lib/new_relic/agent.rb
tannalynn Mar 9, 2023
a6ddc3a
Update test/new_relic/agent_test.rb
tannalynn Mar 9, 2023
e2226c7
Update test/new_relic/agent_test.rb
tannalynn Mar 9, 2023
c2dd5bd
misc error handling fixes
fallwith Mar 9, 2023
724bf8b
NoticedError: remove defunct request.uri feature
fallwith Mar 9, 2023
9da2e7c
Merge pull request #1871 from newrelic/2023_indy_lego
fallwith Mar 9, 2023
6b3e742
CI: jruby-9.4.1.0 -> jruby-9.4.2.0
fallwith Mar 9, 2023
acf21eb
Merge branch 'dev' into yojimbo
fallwith Mar 9, 2023
5f556b1
Merge branch 'dev' into jruby9410
fallwith Mar 9, 2023
54130a6
CHANGELOG entry for JRuby 9.4.2.0 CI
fallwith Mar 9, 2023
b919bab
Merge pull request #1801 from newrelic/jruby9410
fallwith Mar 9, 2023
7333d85
Merge branch 'dev' into yojimbo
fallwith Mar 9, 2023
8c4dddf
Adds Amazon Timestream ActiveRecord Adapter
wagner Mar 10, 2023
feef4d8
run_tests: support partial filenames
fallwith Mar 10, 2023
aec9c99
NoticedError: handle error group hash correctly
fallwith Mar 10, 2023
14bfda3
bert: scope file finding to unit tests dir only
fallwith Mar 10, 2023
6133e92
Merge pull request #1874 from newrelic/grassregrows
fallwith Mar 10, 2023
17257ac
Merge pull request #1872 from wagner/patch-1
fallwith Mar 10, 2023
e143208
CHANGELOG entry and test accompaniment for 1872
fallwith Mar 10, 2023
f8af886
Merge pull request #1875 from newrelic/tô_suave_meu
fallwith Mar 10, 2023
09cc091
Add safe navigation to parent.name in warn message
kaylareopelle Mar 10, 2023
3695a58
set_error_group_callback - supportability metric
fallwith Mar 10, 2023
bb7f4e1
Revert space change
kaylareopelle Mar 10, 2023
9b478cf
error fingerprinting and user tracking CHANGELOG
fallwith Mar 10, 2023
105bd47
Merge branch 'dev' into yojimbo
fallwith Mar 10, 2023
ea00f07
Merge pull request #1868 from newrelic/error_inbox_user_id
fallwith Mar 13, 2023
eff2022
Update lib/new_relic/supportability_helper.rb
fallwith Mar 13, 2023
3b13513
Merge branch 'error_fingerprinting_user_tracking' into yojimbo
fallwith Mar 13, 2023
314966d
Merge pull request #1858 from newrelic/yojimbo
fallwith Mar 13, 2023
11b03a3
NoticedError: update attr cache for error group
fallwith Mar 13, 2023
04375de
error collector unit test for error_group
fallwith Mar 13, 2023
677c4c8
test_set_user_id_attribute: small tweaks
fallwith Mar 13, 2023
c836ce0
Merge pull request #1882 from newrelic/blackcurrant_tea
fallwith Mar 13, 2023
4b40431
Remove Ruby 2.1 conditions
kaylareopelle Mar 14, 2023
8bb8593
Move constant above RDoc
kaylareopelle Mar 14, 2023
7c1af90
Merge pull request #1887 from newrelic/move-supportability-metric-for…
kaylareopelle Mar 14, 2023
6265e61
Merge pull request #1886 from newrelic/remove-21-conditions
kaylareopelle Mar 14, 2023
b7f17eb
Reduce log level to debug
kaylareopelle Mar 14, 2023
51f888f
Set transaction.async during thread_block_with_current_transaction
kaylareopelle Mar 14, 2023
901fd21
Fix typo
kaylareopelle Mar 14, 2023
623b8e5
Correctly add error_group key
hannahramadan Mar 14, 2023
e29ba89
Merge pull request #1889 from newrelic/what_if_agent_attributes_isnt_…
hannahramadan Mar 15, 2023
642d0fd
Use send instead
kaylareopelle Mar 15, 2023
4ad9f5a
remove unsupported version testing
tannalynn Mar 15, 2023
07eff22
add test:multiverse:gem_manifest rake task
fallwith Mar 15, 2023
3140248
Merge branch 'dev' into hercule_poirot
fallwith Mar 16, 2023
794f872
Add CHANGELOG entry
kaylareopelle Mar 16, 2023
3dc000d
Merge pull request #1812 from newrelic/hercule_poirot
fallwith Mar 16, 2023
8a0c06c
Merge pull request #1876 from newrelic/bugfix/transaction_finish_nil_…
kaylareopelle Mar 16, 2023
94beca3
Increase failedThresholdBranch to 85
kaylareopelle Mar 16, 2023
9b0e5c4
Merge pull request #1893 from newrelic/increase-branch-coverage-thres…
kaylareopelle Mar 16, 2023
130c3e4
Skip Sidekiq/RedisClient test for Ruby 3.1
kaylareopelle Mar 16, 2023
46f7511
Return clause skip unless sidekiq_without_redis?
kaylareopelle Mar 16, 2023
5dbc20c
Merge pull request #1891 from newrelic/ci-failure-sidekiq-redis
kaylareopelle Mar 16, 2023
4dc42eb
Merge pull request #1892 from newrelic/remove_unsupported_testing
tannalynn Mar 17, 2023
146103c
WIP: initial script yeehaw
hannahramadan Mar 17, 2023
06ce552
test:multiverse:gem_manifest - go faster
fallwith Mar 18, 2023
1f222ce
JavaScriptInstrumentor: log about custom attrs
fallwith Mar 20, 2023
df0025f
Test: GHA release note run
hannahramadan Mar 20, 2023
6f2c5aa
Udpate workflow path
hannahramadan Mar 20, 2023
c20cc28
Run on PR
hannahramadan Mar 20, 2023
1c5c5c5
Change path: Ruby agent
hannahramadan Mar 20, 2023
c3f3e91
Create new destination path
hannahramadan Mar 20, 2023
5871b97
Change action name
hannahramadan Mar 20, 2023
066597e
new action!
hannahramadan Mar 20, 2023
4ed1e94
Update branch name -> develop
hannahramadan Mar 20, 2023
aa62e8d
empty commit to push CI along
fallwith Mar 20, 2023
37d0720
Merge pull request #1890 from newrelic/sparkling_green_tea
fallwith Mar 20, 2023
edad4ed
try to get file uploaded
hannahramadan Mar 20, 2023
289c8b1
restore railsedge testing
fallwith Mar 21, 2023
f8c0155
Merge pull request #1898 from newrelic/take_it_away_the_edge
fallwith Mar 21, 2023
ecffd80
test: echo statments
hannahramadan Mar 23, 2023
ebe2385
remove path
hannahramadan Mar 23, 2023
93dd352
command redo
hannahramadan Mar 23, 2023
d1e85c5
$
hannahramadan Mar 23, 2023
fbe26bb
remove echo
hannahramadan Mar 23, 2023
7969776
Final commit!
hannahramadan Mar 23, 2023
316bcdc
Delete make_release_notes.yml
hannahramadan Mar 23, 2023
8998598
Delete release_notes_pr.yml
hannahramadan Mar 23, 2023
941f3f2
Update filename
hannahramadan Mar 23, 2023
57619bd
Merge pull request #1896 from newrelic/aardvark
fallwith Mar 23, 2023
002c7f8
Update parse_changelog.rb
hannahramadan Mar 24, 2023
2d074f0
Update .github/workflows/scripts/parse_changelog.rb
hannahramadan Mar 24, 2023
78452c8
Merge branch 'test_mdx_parser' of github.com:newrelic/newrelic-ruby-a…
hannahramadan Mar 24, 2023
a637ebc
CHANGELOG updates for error inbox features
fallwith Mar 25, 2023
8629f0d
Merge branch 'dev' into error_fingerprinting_user_tracking
fallwith Mar 25, 2023
168e466
errors inbox CHANGELOG updates for dev merge
fallwith Mar 25, 2023
a8d966d
Update CHANGELOG.md
fallwith Mar 27, 2023
7bc24ca
Make script classy
hannahramadan Mar 27, 2023
71ad8ad
Update .github/workflows/scripts/generate_release_notes.rb
hannahramadan Mar 27, 2023
99ef842
Merge pull request #1897 from newrelic/test_mdx_parser
hannahramadan Mar 27, 2023
6eae525
Merge pull request #1883 from newrelic/error_fingerprinting_user_trac…
fallwith Mar 27, 2023
13478cb
v9.1.0
fallwith Mar 28, 2023
a5d5bad
Merge pull request #1912 from newrelic/v910
fallwith Mar 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
name: Prepare mysql directory
run: sudo chown -R $USER /usr/local

- if: matrix.ruby-version == '2.4.10'
- if: matrix.ruby-version == '2.4.10'
name: Cache mysql55
id: mysql55-cache
uses: actions/[email protected]
Expand Down Expand Up @@ -265,6 +265,16 @@ jobs:
path: lib/coverage_*/.resultset.json
retention-days: 2

- name: Generate gem manifest
run: rake test:multiverse:gem_manifest

- name: Save gem manifest
uses: actions/upload-artifact@v3
with:
name: gem_manifest_${{ matrix.ruby-version }}.json
path: gem_manifest_${{ matrix.ruby-version }}.json
retention-days: 2


infinite_tracing:
needs: run_rubocop
Expand Down Expand Up @@ -336,4 +346,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
resultPath: lib/coverage_results/.last_run.json
failedThreshold: 93
failedThresholdBranch: 84
failedThresholdBranch: 85
9 changes: 4 additions & 5 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
with:
ruby-version: ${{ matrix.ruby-version }}

# ,railsedge goes in 2.7+
- name: Set up mini-envs for ruby version
uses: kanga333/variable-mapper@master
with:
Expand All @@ -71,16 +70,16 @@ jobs:
"rails": "norails,rails61,rails60,rails52,rails51,rails42"
},
"2.7.7": {
"rails": "norails,rails61,rails60,rails70"
"rails": "norails,rails61,rails60,rails70,railsedge"
},
"3.0.5": {
"rails": "norails,rails61,rails60,rails70"
"rails": "norails,rails61,rails60,rails70,railsedge"
},
"3.1.3": {
"rails": "norails,rails61,rails70"
"rails": "norails,rails61,rails70,railsedge"
},
"3.2.1": {
"rails": "norails,rails61,rails70"
"rails": "norails,rails61,rails70,railsedge"
}
}

Expand Down
23 changes: 3 additions & 20 deletions .github/workflows/ci_jruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,10 @@ jobs:
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@v3

# - curl is needed for Curb
# - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5
# - sasl is needed for memcached
- name: Install OS packages
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev

- name: Install Ruby jruby-9.3.9.0
- name: Install Ruby jruby-9.4.2.0
uses: ruby/setup-ruby@v1
with:
ruby-version: jruby-9.3.9.0
ruby-version: jruby-9.4.2.0

- name: Bundle
run: bundle install
Expand Down Expand Up @@ -122,12 +116,6 @@ jobs:
matrix:
multiverse: [agent, background, background_2, database, frameworks, httpclients, httpclients_2, rails, rest]
steps:
- name: Set the default Java version
run: sudo update-alternatives --set java ${JAVA_HOME_8_X64}/bin/java &&
sudo update-alternatives --set javac ${JAVA_HOME_8_X64}/bin/javac &&
java -version &&
javac -version

- name: Configure git
run: 'git config --global init.defaultBranch main'

Expand All @@ -137,14 +125,10 @@ jobs:
- name: Install JRuby
uses: ruby/setup-ruby@v1
with:
ruby-version: jruby-9.3.9.0
env:
JAVA_HOME: /usr/lib/jvm/temurin-8-jdk-amd64
ruby-version: jruby-9.4.2.0

- name: Bundle
run: bundle install
env:
JAVA_HOME: /usr/lib/jvm/temurin-8-jdk-amd64

- name: Run Multiverse Tests
run: ./.github/workflows/scripts/retry_command
Expand All @@ -155,7 +139,6 @@ jobs:
SERIALIZE: 1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
JRUBY_OPTS: --dev --debug
JAVA_HOME: /usr/lib/jvm/temurin-8-jdk-amd64

- name: Annotate errors
if: ${{ failure() }}
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/scripts/generate_release_notes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/ruby
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require 'date'
require_relative '../../../lib/new_relic/version'

class GenerateReleaseNotes
DIVIDER = '---'
SUPPORT_STATEMENT = <<~SUPPORT_STATEMENT
<Callout variant="important">
We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version at most 90 days old. Read more about [keeping agents up to date](/docs/new-relic-solutions/new-relic-one/install-configure/update-new-relic-agent/).

See the New Relic Ruby agent [EOL policy](https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/ruby-agent-eol-policy/) for information about agent releases and support dates.
</Callout>
SUPPORT_STATEMENT

def build_metadata
changelog = File.read('CHANGELOG.md')
latest_entry = changelog.split('##')[1].prepend('##')
titles = latest_entry.scan(/^- \*{2}(.*?)\*{2}$/).flatten # Match strings between sets of '**'
metadata = Hash.new { |h, k| h[k] = [] }

titles.each do |t|
category = t.split(':').first
case category
when 'Feature'
metadata[:features] << t.delete_prefix('Feature: ')
when 'Bugfix'
metadata[:bugs] << t.delete_prefix('Bugfix: ')
when 'Security'
metadata[:security] << t.delete_prefix('Security: ')
end
end

return metadata, latest_entry
end

def build_release_content
metadata, latest_entry = build_metadata
<<~FRONTMATTER
#{DIVIDER}
subject: Ruby agent
date: #{Date.today}
version: #{NewRelic::VERSION::STRING}
downloadLink: https://rubygems.org/downloads/newrelic_rpm-#{NewRelic::VERSION::STRING}.gem
features: #{metadata[:features]}
bugs: #{metadata[:bugs]}
security: #{metadata[:security]}
#{DIVIDER}

#{SUPPORT_STATEMENT}
#{latest_entry}
FRONTMATTER
end

def write_filename
"ruby-agent-#{NewRelic::VERSION::STRING.tr('.', '-')}.mdx"
end

def write_output_file
File.write(write_filename, build_release_content)
end
end

GenerateReleaseNotes.new.write_output_file
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ vendor/
Brewfile.lock.json
.github/actions/simplecov-report/lib/
test/minitest/minitest_time_report
gem_manifest_*.json
22 changes: 6 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Style/RedundantEach: # new in 1.38
Enabled: true
Style/RedundantInitialize: # new in 1.27
Enabled: true
Style/RedundantStringEscape: # new in 1.37
Style/RedundantStringEscape: # new in 1.37, 'pending' by default so enabled to make sure it's applied
Enabled: true
Style/YodaExpression: # new in 1.42
Enabled: true
Expand Down Expand Up @@ -140,7 +140,8 @@ Performance/StringIdentifierArgument: # new in 1.13
Enabled: true
Performance/StringInclude: # new in 1.7
Enabled: true

Performance/Sum: # new in 1.8, pending so left enabled explicitly until 2.0
Enabled: true

# Old cops

Expand Down Expand Up @@ -1255,9 +1256,6 @@ Style/DocumentationMethod:
Style/DoubleCopDisableDirective:
Enabled: false

Style/DoubleNegation:
Enabled: false

Style/EachForSimpleLoop:
Enabled: true

Expand Down Expand Up @@ -1318,6 +1316,9 @@ Style/ExplicitBlockArgument:
Style/ExponentialNotation:
Enabled: false

Style/FetchEnvVar:
Enabled: false

Style/FloatDivision:
Enabled: false

Expand Down Expand Up @@ -1781,17 +1782,6 @@ Style/StringConcatenation:
Style/StringHashKeys:
Enabled: false

# Disabling for now
Style/StringLiterals:
Enabled: false
# EnforcedStyle: double_quotes
# ConsistentQuotesInMultiline: false

# Disabling for now
Style/StringLiteralsInInterpolation:
Enabled: false
# EnforcedStyle: double_quotes

Style/StringMethods:
Enabled: false

Expand Down
47 changes: 4 additions & 43 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# Offense count: 422
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 54
Max: 40
Exclude:
- test/**/*
- infinite_tracing/test/**/*
- lib/new_relic/cli/commands/deployments.rb
- test/**/*

# This cop supports safe autocorrection (--autocorrect).
Minitest/AssertInDelta:
Expand All @@ -36,6 +37,7 @@ Minitest/DuplicateTestRun:
Minitest/EmptyLineBeforeAssertionMethods:
Exclude:
- 'test/new_relic/agent_test.rb'
- 'test/new_relic/cli/commands/deployments_test.rb'

# Offense count: 269
Minitest/MultipleAssertions:
Expand All @@ -57,44 +59,3 @@ Style/ConcatArrayLiterals:
Minitest/RefuteRespondTo:
Exclude:
- 'test/new_relic/cli/commands/deployments_test.rb'

Minitest/EmptyLineBeforeAssertionMethods:
Exclude:
- 'test/new_relic/agent_test.rb'
- 'test/new_relic/cli/commands/deployments_test.rb'

# Offense count: 23
# This cop supports safe autocorrection (--autocorrect).
Performance/RegexpMatch:
Enabled: false

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: OnlySumOrWithInitialValue.
Performance/Sum:
Exclude:
- 'lib/new_relic/agent/system_info.rb'

# Offense count: 72
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/UnfreezeString:
Enabled: false

# Offense count: 21
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars.
Style/FetchEnvVar:
Enabled: false

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantStringEscape:
Exclude:
- 'test/new_relic/agent/logging_test.rb'

# Offense count: 115
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Enabled: false
2 changes: 1 addition & 1 deletion .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ end
SimpleCov.start do
enable_coverage(:branch)
SimpleCov.root(File.join(File.dirname(__FILE__), '/lib'))
track_files("**/*.rb")
track_files('**/*.rb')
formatter(SimpleCov::Formatter::SimpleFormatter) if ENV['CI']
end
62 changes: 60 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# New Relic Ruby Agent Release Notes

## v9.1.0

Version 9.1.0 of the agent delivers support for two new [errors inbox](https://docs.newrelic.com/docs/errors-inbox/errors-inbox/) features: error fingerprinting and user tracking, identifies the Amazon Timestream data store, removes Distributed Tracing warnings from agent logs when using Sidekiq, fixes bugs, and is tested against the recently released JRuby 9.4.2.0.

- **Feature: Error fingerprinting - supply your own errors inbox group names**

Are your error occurrences grouped poorly? Set your own error fingerprint via a callback function. A new `set_error_group_callback` public API method has been added that will accept a user defined proc. The proc will be invoked for each noticed error and whenever it returns a string, that string will be used as the error group name for the error and will take precedence over any server-side grouping that takes place with the New Relic errors inbox. This gives users much greater control over the grouping of their errors.

The customer defined proc will be expected to receive exactly one input argument, a hash. The hash contains the following:

| Key | Value |
| ---------------------| ---------------------------------------------------------------------------- |
| `:error` | The Ruby error class instance. Offers `#class`, `#message`, and `#backtrace` |
| `:customAttributes` | Any customer defined custom attributes for the current transaction |
| `:'request.uri'` | The current request URI if available |
| `:'http.statusCode'` | The HTTP status code (200, 404, etc.) if available |
| `:'http.method'` | The HTTP method (GET, PUT, etc.) if available |
| `:'error.expected'` | Whether (true) or not (false) the error was expected |
| `:'options'` | The options hash passed to `NewRelic::Agent.notice_error` |

The callback only needs to be set once per initialization of the New Relic agent.

Example usage:

```
proc = proc { |hash| "Access" if hash[:'http.statusCode'] == 401 }
NewRelic::Agent.set_error_group_callback(proc)
```

- **Feature: User tracking - associate errors with a user id**

You can now see the number of users impacted by an error group. Identify the end user with a new `set_user_id` public API method that will accept a string representation of a user id and associate that user id with the current transaction. Transactions and errors will then have a new `enduser.id` agent attribute associated with them. This will allow agent users to tag transactions and errors as belonging to given user ids in support of greater filtering and alerting capabilities.

- **Identify Amazon Timestream when the amazon_timestream AR adapter is used**

When the agent sees the [activerecord-amazon-timestream-adapter](https://rubygems.org/gems/activerecord-amazon-timestream-adapter) gem being used, it will now identify the data store as "Timestream". Thanks very much to [@wagner](https://github.com/wagner) for contributing this enhancement! [PR#1872](https://github.com/newrelic/newrelic-ruby-agent/pull/1872)

- **Bugfix: Remove Distributed Tracing related warnings from agent logs when headers are not present in Sidekiq**

Previously, the agent would log a warning to `newrelic_agent.log` every time it attempted to accept empty Distributed Tracing headers from Sidekiq jobs which could result in an excessive number of warnings. Now the agent will no longer create these warnings when using Sidekiq. [PR#1834](https://github.com/newrelic/newrelic-ruby-agent/pull/1834)

- **Bugfix: Log request headers in debug-level logs instead of human-readable Objects**

Previously, the agent sometimes received children of the `NewRelic::Agent::HTTPClients::AbstractRequest` class as an argument when `NewRelic::Agent::Transaction::DistributedTracers#log_request_headers` was called. This caused debug-level log messages that print the request headers to show human-readable Objects (ex. `#<NewRelic::Agent::HTTPClients::HTTPClientRequest:0x00007fd0dda983e0>`) instead of the request headers. Now, the hash of the request headers should always be logged. [PR#1839](https://github.com/newrelic/newrelic-ruby-agent/pull/1839)

- **Bugfix: Fix undefined method `controller_path` logged in Action Controller Instrumentation**

Previously, the agent could log an error when trying to determine the metric name in the Action Controller instrumentation if the controller class did not respond to `controller_path`. This has been resolved and the agent will no longer call this method unless the class responds to it. Thank you to [@gsar](https://github.com/gsar) for letting us know about this issue. [PR#1844](https://github.com/newrelic/newrelic-ruby-agent/pull/1844)

- **Bugfix: Fix Transaction#finish exception and decrease log level for related warning during async transactions**

Previously, the agent would raise a non-fatal error when a segment without a parent was unfinished when the transaction completed. This error was raised while constructing a `warn`-level log message. Now that Thread instrumentation is on by default, this log message emits more frequently and is less concerning. In cases where we see a Thread, Fiber, or concurrent-ruby segment in a transaction, the message will be degraded to a `debug`-level. Thanks to [@NielsKSchjoedt](https://github.com/NielsKSchjoedt) for creating the issue and [@boomer196](https://github.com/boomer196) for testing solutions. [PR#1876](https://github.com/newrelic/newrelic-ruby-agent/pull/1876)

- **CI: Target JRuby 9.4.2.0**

The agent is now actively being tested against JRuby 9.4.2.0. NOTE that this release does not contain any non-CI related changes for JRuby. Old agent versions are still expected to work with newer JRubies and the newest agent version is still expected to work with older JRubies.


## v9.0.0

Version 9.0.0 of the agent removes several deprecated configuration options and API methods, enables Thread tracing by default, adds Fiber instrumentation, removes support for Ruby versions 2.2 and 2.3, removes instrumentation for several deprecated gems, changes how the API method `set_transaction_name` works, and updates `rails_defer_initialization` to be an environment variable only configuration option.
Expand Down Expand Up @@ -92,8 +150,8 @@
- HttpClient: 2.2.0 - 2.8.0
- HttpRb: 0.9.9 - 2.2.1
- Typhoeus: 0.5.3 - 1.2.x
- Bunny: 2.0.x - 2.6.x
- ActiveMerchant: 1.25.0 - 1.64.x
- Bunny: 2.0.x - 2.6.x
- ActiveMerchant: 1.25.0 - 1.64.x


- **Updated API method `set_transaction_name`**
Expand Down
Loading