Sha256: bb502ef74489c18e269392e591e590b203531a66baade202e2e3d6da68e9a91a
Contents?: true
Size: 697 Bytes
Versions: 10
Compression:
Stored size: 697 Bytes
Contents
# frozen_string_literal: true module PlainApm module Extensions module Context module ActiveJob # 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 super.update("trace_id" => trace_id) end def deserialize(job) PlainApm::Extensions::Context.trace_id = job["trace_id"] super(job) end end ## # Allow tracing request ID through jobs ActiveSupport.on_load(:active_job) do |klass| klass.prepend(ActiveJob) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems