Sha256: ede0d0eee2e3821482f28a17d003f92c690390ba3dace99daa52fc1de8ee3a9e

Contents?: true

Size: 903 Bytes

Versions: 34

Compression:

Stored size: 903 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
  module Agent
    module Instrumentation
      module GRPC
        module Helper
          NR_8T_HOST_PATTERN = %r{tracing\.(?:staging-)?edge\.nr-data}.freeze

          def cleaned_method(method)
            method = method.to_s unless method.is_a?(String)
            return method unless method.start_with?('/')

            method[1..-1]
          end

          def host_denylisted?(host)
            return false unless host

            ignore_patterns.any? { |regex| host.match?(regex) }
          end

          def ignore_patterns
            ([NR_8T_HOST_PATTERN] + NewRelic::Agent.config[:'instrumentation.grpc.host_denylist']).freeze
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
newrelic_rpm-9.17.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.16.1 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.15.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.6.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.5.0 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.4.2 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.4.1 lib/new_relic/agent/instrumentation/grpc/helper.rb
newrelic_rpm-9.4.0 lib/new_relic/agent/instrumentation/grpc/helper.rb