Class: ElasticAPM::Spies::DynamoDBSpy Private

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_apm/spies/dynamo_db.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Modules: Ext

Constant Summary collapse

TYPE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'db'
SUBTYPE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'dynamodb'
ACTION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'query'
@@formatted_op_names =

This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.

Concurrent::Map.new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.formatted_op_name(operation_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



47
48
49
50
51
# File 'lib/elastic_apm/spies/dynamo_db.rb', line 47

def self.formatted_op_name(operation_name)
  @@formatted_op_names.compute_if_absent(operation_name) do
    operation_name.to_s.split('_').collect(&:capitalize).join
  end
end

.span_name(operation_name, params) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
44
45
# File 'lib/elastic_apm/spies/dynamo_db.rb', line 41

def self.span_name(operation_name, params)
  params[:table_name] ?
    "DynamoDB #{formatted_op_name(operation_name)} #{params[:table_name]}" :
    "DynamoDB #{formatted_op_name(operation_name)}"
end

.without_net_httpObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
34
35
36
37
38
39
# File 'lib/elastic_apm/spies/dynamo_db.rb', line 31

def self.without_net_http
  return yield unless defined?(NetHTTPSpy)

  # rubocop:disable Style/ExplicitBlockArgument
  ElasticAPM::Spies::NetHTTPSpy.disable_in do
    yield
  end
  # rubocop:enable Style/ExplicitBlockArgument
end

Instance Method Details

#installObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



92
93
94
# File 'lib/elastic_apm/spies/dynamo_db.rb', line 92

def install
  ::Aws::DynamoDB::Client.prepend(Ext)
end