Module: WCC::Contentful::Instrumentation

Extended by:
ActiveSupport::Concern
Included in:
Middleware::Store::CachingMiddleware, SimpleClient, SimpleClient::Response, Store::PostgresStore
Defined in:
lib/wcc/contentful/instrumentation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#_instrumentationObject



16
17
18
19
# File 'lib/wcc/contentful/instrumentation.rb', line 16

def _instrumentation
  # look for per-instance instrumentation then try class level
  @_instrumentation || self.class._instrumentation
end

Class Method Details

.instrument(name, payload = {}, &block) ⇒ Object



44
45
46
47
# File 'lib/wcc/contentful/instrumentation.rb', line 44

def instrument(name, payload = {}, &block)
  WCC::Contentful::Services.instance
    .instrumentation.instrument(name, payload, &block)
end

Instance Method Details

#_instrumentation_event_prefixObject



7
8
9
10
11
12
# File 'lib/wcc/contentful/instrumentation.rb', line 7

def _instrumentation_event_prefix
  @_instrumentation_event_prefix ||=
    # WCC::Contentful => contentful.wcc
    '.' + (is_a?(Class) || is_a?(Module) ? self : self.class) # rubocop:disable Style/StringConcatenation
      .name.parameterize.split('-').reverse.join('.')
end