Sha256: 47b725eb61c5fbf0393f2c54f8e78a24841cde9aa153516504c95610eddbb24f

Contents?: true

Size: 676 Bytes

Versions: 7

Compression:

Stored size: 676 Bytes

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module NewRelic::Agent::Instrumentation
  module ConcurrentRuby
    SEGMENT_NAME = 'Concurrent/Task'
    SUPPORTABILITY_METRIC = 'Supportability/ConcurrentRuby/Invoked'

    def add_task_tracing(*args, &task)
      NewRelic::Agent.record_metric_once(SUPPORTABILITY_METRIC)

      NewRelic::Agent::Tracer.thread_block_with_current_transaction(
        *args,
        segment_name: SEGMENT_NAME,
        parent: NewRelic::Agent::Tracer.current_segment,
        &task
      )
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-9.2.2 lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb
newrelic_rpm-9.2.1 lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb
newrelic_rpm-9.2.0 lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb
newrelic_rpm-9.1.0 lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb
newrelic_rpm-9.0.0 lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb
newrelic_rpm-8.16.0 lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb
newrelic_rpm-8.15.0 lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb