Class: ScoutApm::LayerErrorConverter

Inherits:
LayerConverterBase show all
Defined in:
lib/scout_apm/layer_converter.rb

Instance Attribute Summary

Attributes inherited from LayerConverterBase

#request, #root_layer, #walker

Instance Method Summary collapse

Methods inherited from LayerConverterBase

#initialize, #scope_layer

Constructor Details

This class inherits a constructor from ScoutApm::LayerConverterBase

Instance Method Details

#callObject



72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/scout_apm/layer_converter.rb', line 72

def call
  scope = scope_layer

  # Should we mark a request as errored out if a middleware raises?
  # How does that interact w/ a tool like Sentry or Honeybadger?
  return {} unless scope
  return {} unless request.error?

  meta = MetricMeta.new("Errors/#{scope.legacy_metric_name}", {})
  stat = MetricStats.new
  stat.update!(1)

  { meta => stat }
end