Sha256: 4645bd435e5e1debd028f74c82cb30a972885bbded9bcf816cdb017316aa0232
Contents?: true
Size: 881 Bytes
Versions: 17
Compression:
Stored size: 881 Bytes
Contents
# frozen_string_literal: true module PlainApm module Extensions module Context module ActiveJob # Timestamp when job was deserialized (popped off of the queue). attr_accessor :dequeued_at # TODO: would it be useful to de-serialize the whole context (e.g. user # IDs, subscriptions, etc?) def serialize trace_id = PlainApm::Extensions::Context.trace_id || SecureRandom.uuid # Rails wasn't preserving the nano-time, this has now been fixed # upstream in #39698 and fixed in Rails 7.1. super.update("trace_id" => trace_id, "enqueued_at" => Time.now.utc.iso8601(9)) end def deserialize(job) PlainApm::Extensions::Context.trace_id = job["trace_id"] self.dequeued_at = Time.now.utc.iso8601(9) super(job) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems