lib/opentelemetry/instrumentation/aws_sdk/handler.rb in opentelemetry-instrumentation-aws_sdk-0.3.0 vs lib/opentelemetry/instrumentation/aws_sdk/handler.rb in opentelemetry-instrumentation-aws_sdk-0.3.1
- old
+ new
@@ -12,11 +12,11 @@
SQS_SEND_MESSAGE = 'SQS.SendMessage'
SQS_SEND_MESSAGE_BATCH = 'SQS.SendMessageBatch'
SQS_RECEIVE_MESSAGE = 'SQS.ReceiveMessage'
SNS_PUBLISH = 'SNS.Publish'
- def call(context) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
+ def call(context) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
return super unless context
service_name = service_name(context)
operation = context.operation&.name
client_method = "#{service_name}.#{operation}"
@@ -56,10 +56,10 @@
def instrumentation_config
AwsSdk::Instrumentation.instance.config
end
- def service_name(context) # rubocop:disable Metrics/AbcSize
+ def service_name(context)
# Support aws-sdk v2.0.x, which 'metadata' has a setter method only
return context.client.class.to_s.split('::')[1] if ::Seahorse::Model::Api.instance_method(:metadata).parameters.length.positive?
context.client.class.api.metadata['serviceId'] || context.client.class.to_s.split('::')[1]
end