Sha256: 65cd5199f493ca6f665d896c79a6ef993a8ee34b7faafe7ed3c283401c1ca5f3

Contents?: true

Size: 725 Bytes

Versions: 4

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

# Copyright 2019 OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module CorrelationContext
    # No op implementation of CorrelationContext::Manager
    class Manager
      NOOP_BUILDER = Builder.new
      private_constant :NOOP_BUILDER

      def build(context: Context.current)
        yield NOOP_BUILDER
        context
      end

      def set_value(key, value, context: Context.current)
        context
      end

      def value(key, context: Context.current)
        nil
      end

      def remove_value(key, context: Context.current)
        context
      end

      def clear(context: Context.current)
        context
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opentelemetry-api-0.5.1 lib/opentelemetry/correlation_context/manager.rb
opentelemetry-api-0.5.0 lib/opentelemetry/correlation_context/manager.rb
opentelemetry-api-0.4.0 lib/opentelemetry/correlation_context/manager.rb
opentelemetry-api-0.3.0 lib/opentelemetry/correlation_context/manager.rb