Class: Skylight::Normalizers::Normalizer Private

Inherits:
Object
  • Object
show all
Includes:
Util::Logging
Defined in:
lib/skylight/normalizers.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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util::Logging

#config_for_logging, #debug, #error, #fmt, #info, #log, #log_context, #raise_on_error?, #t, #trace, #trace?, #warn

Constructor Details

#initialize(config) ⇒ Normalizer

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.

Returns a new instance of Normalizer.



57
58
59
60
# File 'lib/skylight/normalizers.rb', line 57

def initialize(config)
  @config = config
  setup if respond_to?(:setup)
end

Instance Attribute Details

#configObject (readonly)

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.



53
54
55
# File 'lib/skylight/normalizers.rb', line 53

def config
  @config
end

Class Method Details

.register(name, opts = {}) ⇒ 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.



49
50
51
# File 'lib/skylight/normalizers.rb', line 49

def self.register(name, opts = {})
  Normalizers.register(name, self, opts)
end

Instance Method Details

#normalize(_trace, _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.



62
63
64
# File 'lib/skylight/normalizers.rb', line 62

def normalize(_trace, _name, _payload)
  :skip
end

#normalize_after(trace, span, 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.



78
79
# File 'lib/skylight/normalizers.rb', line 78

def normalize_after(trace, span, name, payload)
end

#normalize_with_meta(trace, 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.



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/skylight/normalizers.rb', line 66

def normalize_with_meta(trace, name, payload)
  # If we have a normal response but no meta, add it
  cat, title, desc, meta = ret = normalize(trace, name, payload)
  return cat if cat == :skip

  meta ||= {}
  cache_key = ret.hash
  process_meta(trace, name, payload, meta, cache_key: cache_key)

  [cat, title, desc, meta]
end