Skip to content

Commit

Permalink
Merge pull request #2295 from dinsley/fix-agent-usage-consistency
Browse files Browse the repository at this point in the history
Fixes the consistency for the capitalization of 'Agent' -> 'agent' across the project
  • Loading branch information
kaylareopelle authored Nov 1, 2023
2 parents 68fadc2 + 9483116 commit cb72bb5
Show file tree
Hide file tree
Showing 28 changed files with 47 additions and 48 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ The multiverse collection of test suites requires a variety of data handling sof
- **Additional Transaction Information applied to Span Events**
When Distributed Tracing and/or Infinite Tracing are enabled, the Agent will now incorporate additional information from the Transaction Event on to the root Span Event of the transaction.
When Distributed Tracing and/or Infinite Tracing are enabled, the agent will now incorporate additional information from the Transaction Event on to the root Span Event of the transaction.
The following items are affected:
Expand Down
4 changes: 2 additions & 2 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Using Docker with the New Relic Ruby Agent
# Using Docker with the New Relic Ruby agent

These instructions will guide you through the process of setting up Docker for
use with developing the New Relic Ruby Agent. The use of Docker containers can
use with developing the New Relic Ruby agent. The use of Docker containers can
provide for a consistent experience free from machine specific issues.

## Quick Start
Expand Down
4 changes: 2 additions & 2 deletions infinite_tracing/lib/infinite_tracing/agent_integrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
module NewRelic::Agent
module InfiniteTracing
if Config.enabled? || Config.test_framework?
NewRelic::Agent.logger.debug('Integrating Infinite Tracer with Agent')
NewRelic::Agent.logger.debug('Integrating Infinite Tracer with agent')

require_relative 'agent_integrations/agent'
require_relative 'agent_integrations/segment'
require_relative 'agent_integrations/datastore_segment'
require_relative 'agent_integrations/external_request_segment'

else
NewRelic::Agent.logger.debug('Skipped Integrating Infinite Tracer with Agent')
NewRelic::Agent.logger.debug('Skipped Integrating Infinite Tracer with agent')
end
end
end
2 changes: 1 addition & 1 deletion infinite_tracing/lib/infinite_tracing/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def wait_for_agent_connect
end
end

# The metadata for the RPC calls is a blocking call waiting for the Agent to
# The metadata for the RPC calls is a blocking call waiting for the agent to
# connect and receive the server side configuration, which contains the license_key
# as well as the agent_id (agent_run_token).
def metadata
Expand Down
2 changes: 1 addition & 1 deletion infinite_tracing/newrelic-infinite_tracing.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Gem::Specification.new do |s|
New Relic is a performance management system, developed by New Relic,
Inc (http://www.newrelic.com). New Relic provides you with deep
information about the performance of your web application as it runs
in production. The New Relic Ruby Agent is dual-purposed as a either a
in production. The New Relic Ruby agent is dual-purposed as a either a
Gem or plugin, hosted on https://github.com/newrelic/newrelic-ruby-agent/
EOS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AgentIntegrationTest < Minitest::Test
include FakeTraceObserverHelpers

def test_injects_infinite_tracer
assert ::NewRelic::Agent.instance, 'expected to get an Agent instance'
assert ::NewRelic::Agent.instance, 'expected to get an agent instance'
assert ::NewRelic::Agent.instance.infinite_tracer
end

Expand Down
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

# This is the initialization for the New Relic Ruby Agent when used as
# This is the initialization for the New Relic Ruby agent when used as
# a plugin
require 'new_relic/control'

Expand All @@ -12,7 +12,7 @@
# If you can't find any log files and you don't see anything in your
# application log files please visit support.newrelic.com.

# Initializer for the NewRelic Ruby Agent
# Initializer for the New Relic Ruby agent

# After version 2.0 of Rails we can access the configuration directly.
# We need it to add dev mode routes after initialization finished.
Expand Down
10 changes: 5 additions & 5 deletions lib/new_relic/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def increment_metric(metric_name, amount = 1) # THREAD_LOCAL_ACCESS

# @!group Recording custom errors

# Set a filter to be applied to errors that the Ruby Agent will
# Set a filter to be applied to errors that the Ruby agent will
# track. The block should evaluate to the exception to track
# (which could be different from the original exception) or nil to
# ignore this exception.
Expand Down Expand Up @@ -391,13 +391,13 @@ def record_custom_event(event_type, event_attrs)

# @!group Manual agent configuration and startup/shutdown

# Call this to manually start the Agent in situations where the Agent does
# Call this to manually start the agent in situations where the agent does
# not auto-start.
#
# When the app environment loads, so does the Agent. However, the
# Agent will only connect to the service if a web front-end is found. If
# When the app environment loads, so does the agent. However, the
# agent will only connect to the service if a web front-end is found. If
# you want to selectively monitor ruby processes that don't use
# web plugins, then call this method in your code and the Agent
# web plugins, then call this method in your code and the agent
# will fire up and start reporting to the service.
#
# Options are passed in as overrides for values in the
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

module NewRelic
module Agent
# The Agent is a singleton that is instantiated when the plugin is
# The agent is a singleton that is instantiated when the plugin is
# activated. It collects performance data from ruby applications
# in realtime as the application runs, and periodically sends that
# data to the NewRelic server.
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/agent_helpers/shutdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Shutdown
def shutdown
return unless started?

::NewRelic::Agent.logger.info('Starting Agent shutdown')
::NewRelic::Agent.logger.info('Starting agent shutdown')

stop_event_loop
trap_signals_for_litespeed
Expand Down
4 changes: 2 additions & 2 deletions lib/new_relic/agent/agent_helpers/start_worker_thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ module StartWorkerThread
# See #connect for a description of connection_options.
def start_worker_thread(connection_options = {})
if disable = NewRelic::Agent.config[:disable_harvest_thread]
NewRelic::Agent.logger.info('Not starting Ruby Agent worker thread because :disable_harvest_thread is ' \
NewRelic::Agent.logger.info('Not starting Ruby agent worker thread because :disable_harvest_thread is ' \
"#{disable}")
return
end

::NewRelic::Agent.logger.debug('Creating Ruby Agent worker thread.')
::NewRelic::Agent.logger.debug('Creating Ruby agent worker thread.')
@worker_thread = Threading::AgentThread.create('Worker Loop') do
deferred_work!(connection_options)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/new_relic/agent/agent_helpers/startup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def log_ignore_url_regexes
# so we can disambiguate processes in the log file and make
# sure they're running a reasonable version
def log_version_and_pid
::NewRelic::Agent.logger.debug("New Relic Ruby Agent #{NewRelic::VERSION::STRING} Initialized: pid = #{$$}")
::NewRelic::Agent.logger.debug("New Relic Ruby agent #{NewRelic::VERSION::STRING} initialized: pid = #{$$}")
end

# Logs the configured application names
Expand Down Expand Up @@ -180,7 +180,7 @@ def agent_should_start?

unless app_name_configured?
NewRelic::Agent.logger.error('No application name configured.',
'The Agent cannot start without at least one. Please check your ',
'The agent cannot start without at least one. Please check your ',
'newrelic.yml and ensure that it is valid and has at least one ',
"value set for app_name in the #{NewRelic::Control.instance.env} ",
'environment.')
Expand Down
4 changes: 2 additions & 2 deletions lib/new_relic/agent/attribute_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

# This class applies filtering rules as specified in the Agent Attributes
# This class applies filtering rules as specified in the agent attributes
# cross-agent spec.
#
# Instances of it are constructed by deriving a set of rules from the agent
Expand Down Expand Up @@ -44,7 +44,7 @@
# 1. First, the names are compared lexicographically. This has the impact of
# forcing shorter (more general) rules towards the top of the list and longer
# (more specific) rules towards the bottom. This is important, because the
# Agent Attributes spec stipulates that the most specific rule for a given
# agent Attributes spec stipulates that the most specific rule for a given
# destination should take precedence. Since rules are applied top-to-bottom,
# this sorting guarantees that the most specific rule will be applied last.
# 2. If the names are identical, we next examine the wildcard flag. Rules ending
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/configuration/default_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil)
'before shutting down to be installed regardless of detecting scenarios where it generally should not be. ' \
'Known use-case for this option is where Sinatra is running as an embedded service within another framework ' \
'and the agent is detecting the Sinatra app and skipping the `at_exit` handler as a result. Sinatra classically ' \
'runs the entire application in an `at_exit` block and would otherwise misbehave if the Agent\'s `at_exit` handler ' \
'runs the entire application in an `at_exit` block and would otherwise misbehave if the agent\'s `at_exit` handler ' \
'was also installed in those circumstances. Note: `send_data_on_exit` should also be set to `true` in tandem with this setting.'
},
:high_security => {
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/event_loop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def dispatch_event(event, args)
end

if !errors.empty?
::NewRelic::Agent.logger.error("#{errors.size} error(s) running task for event '#{event}' in Agent Event Loop:", *errors)
::NewRelic::Agent.logger.error("#{errors.size} error(s) running task for event '#{event}' in agent event loop:", *errors)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/instrumentation/active_merchant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ActiveMerchant::Billing::Gateway
executes do
next unless Gem::Version.new(ActiveMerchant::VERSION) < Gem::Version.new('1.65.0')

deprecation_msg = 'The Ruby Agent is dropping support for ActiveMerchant versions below 1.65.0 ' \
deprecation_msg = 'The Ruby agent is dropping support for ActiveMerchant versions below 1.65.0 ' \
'in version 9.0.0. Please upgrade your ActiveMerchant version to continue receiving full support. ' \

NewRelic::Agent.logger.log_once(
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/instrumentation/sinatra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
executes do
next unless Gem::Version.new(Sinatra::VERSION) < Gem::Version.new('2.0.0')

deprecation_msg = 'The Ruby Agent is dropping support for Sinatra versions below 2.0.0 ' \
deprecation_msg = 'The Ruby agent is dropping support for Sinatra versions below 2.0.0 ' \
'in version 9.0.0. Please upgrade your Sinatra version to continue receiving full compatibility. ' \

NewRelic::Agent.logger.log_once(
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/worker_loop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def run_task
raise
rescue => e
# Don't blow out the stack for anything that hasn't already propagated
::NewRelic::Agent.logger.error('Error running task in Agent Worker Loop:', e)
::NewRelic::Agent.logger.error('Error running task in agent worker loop:', e)
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/new_relic/control/frameworks/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def install_browser_monitoring_and_agent_hooks
# Might not be running if it does not think mongrel, thin,
# passenger, etc. is running, if it thinks it's a rake task, or
# if the agent_enabled is false.
::NewRelic::Agent.logger.info('New Relic Agent not running. Skipping browser monitoring and agent hooks.')
::NewRelic::Agent.logger.info('New Relic agent not running. Skipping browser monitoring and agent hooks.')
else
install_browser_monitoring(rails_config)
install_agent_hooks(rails_config)
Expand All @@ -92,9 +92,9 @@ def install_agent_hooks(config)
return unless NewRelic::Rack::AgentHooks.needed?

config.middleware.use(NewRelic::Rack::AgentHooks)
::NewRelic::Agent.logger.debug('Installed New Relic Agent Hooks middleware')
::NewRelic::Agent.logger.debug('Installed New Relic agent hooks middleware')
rescue => e
::NewRelic::Agent.logger.warn('Error installing New Relic Agent Hooks middleware', e)
::NewRelic::Agent.logger.warn('Error installing New Relic agent hooks middleware', e)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/control/instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _install_instrumentation
def rails_32_deprecation
return unless defined?(Rails::VERSION) && Gem::Version.new(Rails::VERSION::STRING) <= Gem::Version.new('3.2')

deprecation_msg = 'The Ruby Agent is dropping support for Rails 3.2 ' \
deprecation_msg = 'The Ruby agent is dropping support for Rails 3.2 ' \
'in a future major release. Please upgrade your Rails version to continue receiving support. ' \

Agent.logger.log_once(
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/config.rake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace :newrelic do
DISABLING => 'Use these settings to toggle instrumentation types during agent startup.',
ATTRIBUTES => '[Attributes](/docs/features/agent-attributes) are key-value pairs containing information that determines the properties of an event or transaction. These key-value pairs can be viewed within transaction traces in APM, traced errors in APM, transaction events in dashboards, and page views in dashboards. You can customize exactly which attributes will be sent to each of these destinations',
'transaction_tracer' => 'The [transaction traces](/docs/apm/traces/transaction-traces/transaction-traces) feature collects detailed information from a selection of transactions, including a summary of the calling sequence, a breakdown of time spent, and a list of SQL queries and their query plans (on mysql and postgresql). Available features depend on your New Relic subscription level.',
'error_collector' => "The agent collects and reports all uncaught exceptions by default. These configuration options allow you to customize the error collection.\n\nFor information on ignored and expected errors, [see this page on Error Analytics in APM](/docs/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected/). To set expected errors via the `NewRelic::Agent.notice_error` Ruby method, [consult the Ruby Agent API](/docs/agents/ruby-agent/api-guides/sending-handled-errors-new-relic/).",
'error_collector' => "The agent collects and reports all uncaught exceptions by default. These configuration options allow you to customize the error collection.\n\nFor information on ignored and expected errors, [see this page on Error Analytics in APM](/docs/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected/). To set expected errors via the `NewRelic::Agent.notice_error` Ruby method, [consult the Ruby agent API](/docs/agents/ruby-agent/api-guides/sending-handled-errors-new-relic/).",
'browser_monitoring' => "The browser monitoring [page load timing](/docs/browser/new-relic-browser/page-load-timing/page-load-timing-process) feature (sometimes referred to as real user monitoring or RUM) gives you insight into the performance real users are experiencing with your website. This is accomplished by measuring the time it takes for your users' browsers to download and render your web pages by injecting a small amount of JavaScript code into the header and footer of each page.",
'application_logging' => "The Ruby agent supports [APM logs in context](/docs/apm/new-relic-apm/getting-started/get-started-logs-context). For some tips on configuring logs for the Ruby agent, see [Configure Ruby logs in context](/docs/logs/logs-context/configure-logs-context-ruby).\n\nAvailable logging-related config options include:",
'analytics_events' => '[New Relic dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-new-relic-one-dashboards) is a resource to gather and visualize data about your software and what it says about your business. With it you can quickly and easily create real-time dashboards to get immediate answers about end-user experiences, clickstreams, mobile activities, and server transactions.'
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/helpers/newrelicyml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module NewRelicYML

HEADER = <<~HEADER
#
# This file configures the New Relic Agent. New Relic monitors Ruby, Java,
# This file configures the New Relic agent. New Relic monitors Ruby, Java,
# .NET, PHP, Python, Node, and Go applications with deep visibility and low
# overhead. For more information, visit www.newrelic.com.
Expand Down
7 changes: 3 additions & 4 deletions newrelic.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file configures the New Relic Agent. New Relic monitors Ruby, Java,
# This file configures the New Relic agent. New Relic monitors Ruby, Java,
# .NET, PHP, Python, Node, and Go applications with deep visibility and low
# overhead. For more information, visit www.newrelic.com.

Expand All @@ -8,8 +8,7 @@
# For full documentation of agent configuration options, please refer to
# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration

common: &default_settings
# Required license key associated with your New Relic account.
common: &default_settings # Required license key associated with your New Relic account.
license_key: <%= license_key %>

# Your application name. Renaming here affects where data displays in New
Expand Down Expand Up @@ -341,7 +340,7 @@ common: &default_settings
# embedded service within another framework and the agent is detecting the Sinatra
# app and skipping the at_exit handler as a result. Sinatra classically runs the
# entire application in an at_exit block and would otherwise misbehave if the
# Agent's at_exit handler was also installed in those circumstances. Note:
# agent's at_exit handler was also installed in those circumstances. Note:
# send_data_on_exit should also be set to true in tandem with this setting.
# force_install_exit_handler: false

Expand Down
Loading

0 comments on commit cb72bb5

Please sign in to comment.