Sha256: 032b578914990c671fe3a9ddb57cfdbaf0165a6a12f6b77023b1c301b863f399
Contents?: true
Size: 769 Bytes
Versions: 11
Compression:
Stored size: 769 Bytes
Contents
# frozen_string_literal: true module InstrumentAllTheThings module Instrumentors DEFAULT_TRACE_OPTIONS = { span_type: '', tags: {}, span_name: 'method.execution', }.freeze TRACE_WRAPPER = proc do |opts, context| opts = if opts == true DEFAULT_TRACE_OPTIONS.dup else DEFAULT_TRACE_OPTIONS.merge(opts) end span_name = opts.delete(:span_name) proc do |klass, next_blk, actual_code| passed_ops = opts.dup passed_ops[:resource] ||= context.trace_name(klass) passed_ops[:tags] ||= {} InstrumentAllTheThings.tracer.trace(span_name, **passed_ops) do next_blk.call(klass, actual_code) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems