Sha256: f0803108ef9eb595c71b9de6221741960233f74663d804f01a217af05d67452a
Contents?: true
Size: 827 Bytes
Versions: 2
Compression:
Stored size: 827 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] ||= {} passed_ops[:type] = passed_ops.delete(:span_type) InstrumentAllTheThings.tracer.trace(span_name, **passed_ops) do next_blk.call(klass, actual_code) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
instrument_all_the_things-5.0.1 | lib/instrument_all_the_things/instrumentors/tracing.rb |
instrument_all_the_things-5.0.0 | lib/instrument_all_the_things/instrumentors/tracing.rb |