Module: LcpRuby::Metrics::Fingerprint
- Defined in:
- lib/lcp_ruby/metrics/fingerprint.rb
Constant Summary collapse
- UUID_PATTERN =
/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i- INTEGER_PATTERN =
/\b\d{2,}\b/
Class Method Summary collapse
-
.compute(error_class, message, stacktrace) ⇒ String
Computes a stable fingerprint for an error.
Class Method Details
.compute(error_class, message, stacktrace) ⇒ String
Computes a stable fingerprint for an error. Normalizes the message (replaces UUIDs and large integers) and uses the error class + normalized message + first stack frame.
17 18 19 20 21 22 23 |
# File 'lib/lcp_ruby/metrics/fingerprint.rb', line 17 def self.compute(error_class, , stacktrace) = (.to_s) first_frame = stacktrace&.first.to_s input = "#{error_class}|#{}|#{first_frame}" Digest::SHA256.hexdigest(input) end |