Skip to content

Commit

Permalink
Merge pull request #2561 from newrelic/dev
Browse files Browse the repository at this point in the history
Release 9.9.0
  • Loading branch information
fallwith authored Apr 17, 2024
2 parents b700dd3 + b1b72dd commit ccde782
Show file tree
Hide file tree
Showing 73 changed files with 1,114 additions and 315 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # tag v1.165.1
with:
ruby-version: '3.3'
Expand All @@ -40,7 +40,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

# - curl is needed for Curb
# - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
--health-timeout 5s
--health-retries 10
elasticsearch8:
image: elasticsearch:8.4.2
image: elasticsearch:8.13.0
env:
discovery.type: single-node
xpack.security.enabled: false
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

# - curl is needed for Curb
# - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5
Expand Down Expand Up @@ -294,7 +294,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # tag v1.165.1
Expand Down Expand Up @@ -336,7 +336,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # tag v1.165.1
with:
ruby-version: '3.1'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # tag v1.165.1
with:
ruby-version: '3.2'
Expand All @@ -41,7 +41,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

# - curl is needed for Curb
# - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

# - curl is needed for Curb
# - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # tag v1.165.1
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 @@ -13,7 +13,7 @@ jobs:
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- name: Install JRuby
uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72 # tag v1.162.0
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
run: 'git config --global init.defaultBranch main'

- name: Check out the source code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- name: Install JRuby
uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72 # tag v1.162.0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/config_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
ruby-version: 3.2

- name: Checkout code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- run: bundle

Expand Down Expand Up @@ -57,10 +57,10 @@ jobs:
if: failure()
steps:
- name: Checkout agent repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- name: Checkout docs website repository
uses: actions/checkout@v3
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
with:
repository: ${{ env.DESTINATION_REPO }}
token: ${{ secrets.NEWRELIC_RUBY_AGENT_BOT_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
outputs:
changed: ${{ steps.branch_change_output.outputs.has-new-commits }}
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- name: check branch changes
id: branch_change_output
uses: adriangl/check-new-commits-action@6556947ca20c2047ed733894258186619b84d282 # tag v1.0.6
Expand All @@ -30,15 +30,15 @@ jobs:
run:
working-directory: ./test/performance
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
with:
ref: 'main'
- uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72 # tag v1.162.0
with:
ruby-version: '3.2'
- run: bundle
- run: bundle exec script/runner -B
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- run: bundle
- run: bundle exec script/runner -C -M > performance_results.md
- name: Save performance results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions: write-all
steps:
- name: Clone the repo
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- name: issue_closer Action
uses: ./.github/actions/issue_closer # no tag - locally sourced
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
ruby-version: 3.2

- name: Checkout code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- run: bundle

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
contents: write
repository-projects: write
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
ruby-version: 3.2
- name: Checkout code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- name: Generate release notes and environment variables
run: |
Expand Down Expand Up @@ -57,13 +57,13 @@ jobs:
if: failure()
steps:
- name: Checkout agent repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- name: Get branch name
run: echo "branch_name=$(ruby -r $PWD/.github/workflows/scripts/generate_release_notes.rb -e GenerateReleaseNotes.new.branch_name)" >> $GITHUB_ENV

- name: Checkout docs website repository
uses: actions/checkout@v3
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
with:
repository: newrelic/docs-website
token: ${{ secrets.NEWRELIC_RUBY_AGENT_BOT_TOKEN }}
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 @@ -19,7 +19,7 @@ jobs:
ruby-version: 3.2

- name: Checkout code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2

- run: bundle

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repolinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
- name: Checkout Self
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- name: Run Repolinter
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: newrelic/repolinter-action@3f4448f855c351e9695b24524a4111c7847b84cb # tag v1.7.0
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/slack_notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72 # tag v1.162.0
with:
ruby-version: 3.2
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- run: gem install httparty
- name: Check for outdated gems
run: ruby .github/workflows/scripts/slack_notifications/gem_notifier.rb ${{ env.gems }}
Expand All @@ -22,28 +22,33 @@ jobs:
bunny
dalli
delayed_job
elasticsearch
excon
http
httpclient
mongo
puma
sidekiq
sinatra
tilt
rack
rails
rake
redis
resque
unicorn"
roda
ruby-openai
sidekiq
sinatra
stripe
tilt
unicorn
view_component"

cve_notifications:
runs-on: ubuntu-22.04
steps:
- uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72 # tag v1.162.0
with:
ruby-version: 3.2
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- run: gem install httparty
- run: gem install feedjira
- name: Check for CVEs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
- name: Setup Ruby
uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72 # tag v1.162.0
with:
Expand Down
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,12 @@ Style/MethodCallWithArgsParentheses:
- add_dependency
- add_development_dependency
- catch
- debug
- expect
- fail
- gem
- include
- info
- print
- puts
- pp
Expand Down
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# New Relic Ruby Agent Release Notes

## v9.9.0

Version 9.9.0 introduces support for AWS Lambda serverless function observability, adds support for Elasticsearch 8.13.0, and adds the 'request.temperature' attribute to chat completion summaries in ruby-openai instrumentation.

- **Feature: Serverless Mode for AWS Lambda**

The Ruby agent is now capable of operating in a quick and light serverless mode suitable for observing AWS Lambda function invocations. For serverless use, the agent is delivered by a New Relic Lambda [layer](https://github.com/newrelic/newrelic-lambda-layers) that can be associated with a Lambda function. All reported data will appear in New Relic's dedicated serverless UI views. Only AWS based Lambda functions are supported for now, though support for other cloud hosted serverless offerings may be added in future depending on Ruby customer demand. The serverless functionality is only intended for use with the official New Relic Ruby layers for Lambda. Any existing workflows that involve the manual use of the Ruby agent in an AWS Lambda context without a New Relic layer should not be impacted.

- **Feature: Add support for Elasticsearch 8.13.0**

Elasticsearch 8.13.0 increased the number of arguments used in the method the agent instruments, `Elastic::Transport::Client#perform_request`. Now, the agent supports a variable number of arguments for the instrumented method to prevent future `ArgumentError`s.

- **Bugfix: Add 'request.temperature' to ruby-openai chat completion summaries**

Previously, the agent was not reporting the `request.temperature` attribute on `LlmChatCompletionSummary` events through ruby-openai instrumentation. We are now reporting this attribute.

## v9.8.0

Version 9.8.0 introduces instrumentation for ruby-openai, adds the option to store tracer state on the thread-level, hardens the browser agent insertion logic to better proactively anticipate errors, and prevents excpetions from being raised in the Active Support Broadcast logger instrumentation.
Expand All @@ -15,7 +31,7 @@ Version 9.8.0 introduces instrumentation for ruby-openai, adds the option to sto
This version introduces two new APIs that allow users to record additional information on LLM events:
* `NewRelic::Agent.record_llm_feedback_event` - Records user feedback events.
* `NewRelic::Agent.set_llm_token_count_callback` - Sets a callback proc for calculating `token_count` attributes for embedding and chat completion message events.

Visit [RubyDoc](https://rubydoc.info/github/newrelic/newrelic-ruby-agent/) for more information on each of these APIs.

- **Feature: Store tracer state on thread-level**
Expand Down Expand Up @@ -49,7 +65,7 @@ Version 9.7.0 introduces ViewComponent instrumentation, changes the endpoint use

- **Feature: ViewComponent instrumentation**

[ViewComponent](https://viewcomponent.org/) is a now an instrumented library. [PR#2367](https://github.com/newrelic/newrelic-ruby-agent/pull/2367)
[ViewComponent](https://viewcomponent.org/) is a now an instrumented library. [PR#2367](https://github.com/newrelic/newrelic-ruby-agent/pull/2367)

- **Feature: Use root path to access Elasticsearch cluster name**

Expand Down
5 changes: 0 additions & 5 deletions config/database.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
mem_limit: 1g
elasticsearch8:
image: elasticsearch:8.4.2
image: elasticsearch:8.13.0
ports:
- "9250:9250"
environment:
Expand Down
13 changes: 1 addition & 12 deletions infinite_tracing/lib/infinite_tracing/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,7 @@ def compression_enabled?
end

def compression_level
@compression_level ||= begin
level = if COMPRESSION_LEVEL_LIST.include?(configured_compression_level)
configured_compression_level
else
NewRelic::Agent.logger.error("Invalid compression level '#{configured_compression_level}' specified! " \
"Must be one of #{COMPRESSION_LEVEL_LIST.join('|')}. Using default level " \
"of '#{COMPRESSION_LEVEL_DEFAULT}'")
COMPRESSION_LEVEL_DEFAULT
end
NewRelic::Agent.logger.debug("Infinite Tracer compression level set to #{level}")
level
end
@compression_level ||= configured_compression_level
end

def configured_compression_level
Expand Down
14 changes: 0 additions & 14 deletions infinite_tracing/test/infinite_tracing/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,6 @@ def test_compression_enabled_returns_false
end
end

def test_invalid_compression_level
reset_compression_level
logger = MiniTest::Mock.new
logger.expect :error, nil, [/Invalid compression level/]
logger.expect :debug, nil, [/compression level set to/]

with_config({'infinite_tracing.compression_level': :bogus}) do
NewRelic::Agent.stub :logger, logger do
assert_equal Config::COMPRESSION_LEVEL_DEFAULT, Config.compression_level
logger.verify
end
end
end

private

def non_test_files
Expand Down
Loading

0 comments on commit ccde782

Please sign in to comment.