diff --git a/CHANGELOG.md b/CHANGELOG.md index 310ffab922..f1afbb3709 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## dev +- **Feature: Add instrumentation for aws-sdk-firehose** + + The agent now has instrumentation for the [aws-sdk-firehose](https://rubygems.org/gems/aws-sdk-firehose) gem. [PR#2973](https://github.com/newrelic/newrelic-ruby-agent/pull/2973) + - **Bugfix: Do not attempt to decorate logs with `nil` messages** The agent no longer attempts to add New Relic linking metadata to logs with `nil` messages. Thank you, [@arlando](https://github.com/arlando) for bringing this to our attention! [Issue#2985](https://github.com/newrelic/newrelic-ruby-agent/issues/2985) [PR#2986](https://github.com/newrelic/newrelic-ruby-agent/pull/2986) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 2ce8e93275..30fc0fe957 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -1559,7 +1559,7 @@ def self.notify :type => String, :dynamic_name => true, :allowed_from_server => false, - :description => 'Controls auto-instrumentation of the aws_sdk_firehose library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.' + :description => 'Controls auto-instrumentation of the aws-sdk-firehose library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.' }, :'instrumentation.aws_sdk_lambda' => { :default => 'auto', diff --git a/lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb b/lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb index 65c22e9e5f..ca63bd0da9 100644 --- a/lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb +++ b/lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb @@ -28,7 +28,7 @@ def instrument_method_with_new_relic(method_name, *args) NewRelic::Agent.record_instrumentation_invocation(FIREHOSE) params = args[0] - segment = NewRelic::Agent::Tracer.start_segment(name: segment_name(method_name, params)) + segment = NewRelic::Agent::Tracer.start_segment(name: get_segment_name(method_name, params)) arn = get_arn(params) if params segment&.add_agent_attribute('cloud.resource_id', arn) if arn @@ -40,7 +40,7 @@ def instrument_method_with_new_relic(method_name, *args) end end - def segment_name(method_name, params) + def get_segment_name(method_name, params) return "#{FIREHOSE}/#{method_name}/#{params[:delivery_stream_name]}" if params&.dig(:delivery_stream_name) "#{FIREHOSE}/#{method_name}"