Class: ElasticAPM::Normalizers::Grape::EndpointRun Private

Inherits:
Normalizer
  • Object
show all
Defined in:
lib/elastic_apm/normalizers/grape/endpoint_run.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.

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.

'app'
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.

'resource'
FRAMEWORK_NAME =

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.

'Grape'

Instance Method Summary collapse

Methods inherited from Normalizer

#initialize, register

Constructor Details

This class inherits a constructor from ElasticAPM::Normalizers::Normalizer

Instance Method Details

#backtrace(payload) ⇒ 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.



45
46
47
48
# File 'lib/elastic_apm/normalizers/grape/endpoint_run.rb', line 45

def backtrace(payload)
  source_location = payload[:endpoint].source.source_location
  ["#{source_location[0]}:#{source_location[1]}"]
end

#normalize(transaction, _name, payload) ⇒ 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.



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/elastic_apm/normalizers/grape/endpoint_run.rb', line 32

def normalize(transaction, _name, payload)
  transaction.name = endpoint(payload[:env])

  if transaction_from_host_app?(transaction)
    transaction.context.set_service(
      framework_name: FRAMEWORK_NAME,
      framework_version: ::Grape::VERSION
    )
  end

  [transaction.name, TYPE, SUBTYPE, nil, nil]
end