Skip to content

Commit

Permalink
Merge pull request #2383 from newrelic/falcon_instrumentation
Browse files Browse the repository at this point in the history
Add support for Falcon
  • Loading branch information
hannahramadan authored Jan 4, 2024
2 parents 1abd790 + 5e2ff03 commit 01befa0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## v9.7.0

Version 9.7.0 changes the endpoint used to access the cluster name for Elasticsearch instrumentation.
Version 9.7.0 changes the endpoint used to access the cluster name for Elasticsearch instrumentation and adds support for Falcon.

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

Expand All @@ -18,6 +18,10 @@ Version 9.7.0 changes the endpoint used to access the cluster name for Elasticse

Thank you, [@Earlopain](https://github.com/Earlopain), for submitting this change. [PR#2378](https://github.com/newrelic/newrelic-ruby-agent/pull/2378)

- **Feature: Add Falcon support**

The agent now supports the web server [Falcon](https://socketry.github.io/falcon/). [PR#2383](https://github.com/newrelic/newrelic-ruby-agent/pull/2383)

## v9.6.0

Version 9.6.0 adds instrumentation for Async::HTTP, Ethon, and HTTPX, adds the ability to ignore specific routes with Roda, gleans Docker container IDs from cgroups v2-based containers, records additional synthetics attributes, fixes an issue with Rails 7.1 that could cause duplicate log records to be sent to New Relic, fixes a deprecation warning for the Sidekiq error handler, adds additional attributes for OpenTelemetry compatibility, and resolves some technical debt, thanks to the community.
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/agent_helpers/special_startup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module SpecialStartup
# requests, we need to wait until the children are forked
# before connecting, otherwise the parent process sends useless data
def using_forking_dispatcher?
if [:puma, :passenger, :unicorn].include?(Agent.config[:dispatcher])
if [:puma, :passenger, :unicorn, :falcon].include?(Agent.config[:dispatcher])
::NewRelic::Agent.logger.info('Deferring startup of agent reporting thread because ' \
"#{Agent.config[:dispatcher]} may fork.")
true
Expand Down
7 changes: 7 additions & 0 deletions lib/new_relic/local_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def discover_dispatcher
unicorn
webrick
fastcgi
falcon
]
while dispatchers.any? && @discovered_dispatcher.nil?
send('check_for_' + (dispatchers.shift))
Expand Down Expand Up @@ -138,6 +139,12 @@ def check_for_puma
end
end

def check_for_falcon
if defined?(::Falcon::Server) && NewRelic::LanguageSupport.object_space_usable?
@discovered_dispatcher = :falcon if find_class_in_object_space(::Falcon::Server)
end
end

def check_for_delayed_job
if $0 =~ /delayed_job$/ || (File.basename($0) == 'rake' && ARGV.include?('jobs:work'))
@discovered_dispatcher = :delayed_job
Expand Down

0 comments on commit 01befa0

Please sign in to comment.