From 805dfc785aba2c58e0459e5570b88822536e5f69 Mon Sep 17 00:00:00 2001 From: Matthew Wear Date: Sat, 1 Feb 2020 15:52:31 -0800 Subject: [PATCH] Rename OpenTelemetry.correlation_context_manager -> OpenTelemetry.correlations --- api/lib/opentelemetry.rb | 6 +++--- api/test/opentelemetry_test.rb | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/lib/opentelemetry.rb b/api/lib/opentelemetry.rb index a25dcec4d..a9b6b2931 100644 --- a/api/lib/opentelemetry.rb +++ b/api/lib/opentelemetry.rb @@ -23,7 +23,7 @@ module OpenTelemetry extend self - attr_writer :tracer_factory, :meter_factory, :correlation_context_manager + attr_writer :tracer_factory, :meter_factory, :correlations attr_accessor :logger @@ -48,8 +48,8 @@ def instrumentation_registry # @return [Object, CorrelationContext::Manager] registered # correlation context manager or a default no-op implementation of the # manager. - def correlation_context_manager - @correlation_context_manager ||= CorrelationContext::Manager.new + def correlations + @correlations ||= CorrelationContext::Manager.new end # @return [Context::Propagation::Propagation] an instance of the propagation API diff --git a/api/test/opentelemetry_test.rb b/api/test/opentelemetry_test.rb index 17c39c219..c70faa0ab 100644 --- a/api/test/opentelemetry_test.rb +++ b/api/test/opentelemetry_test.rb @@ -66,27 +66,27 @@ end end - describe '.correlation_context_manager' do + describe '.correlations' do after do - # Ensure we don't leak custom correlation_context_manager to other tests - OpenTelemetry.correlation_context_manager = nil + # Ensure we don't leak custom correlations to other tests + OpenTelemetry.correlations = nil end it 'returns CorrelationContext::Manager by default' do - manager = OpenTelemetry.correlation_context_manager + manager = OpenTelemetry.correlations _(manager).must_be_instance_of(OpenTelemetry::CorrelationContext::Manager) end it 'returns the same instance when accessed multiple times' do - _(OpenTelemetry.correlation_context_manager).must_equal( - OpenTelemetry.correlation_context_manager + _(OpenTelemetry.correlations).must_equal( + OpenTelemetry.correlations ) end - it 'returns user specified correlation_context_manager' do - custom_manager = 'a custom correlation_context_manager' - OpenTelemetry.correlation_context_manager = custom_manager - _(OpenTelemetry.correlation_context_manager).must_equal(custom_manager) + it 'returns user specified correlations' do + custom_manager = 'a custom correlations' + OpenTelemetry.correlations = custom_manager + _(OpenTelemetry.correlations).must_equal(custom_manager) end end