lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.12.1 vs lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.13.0

- old
+ new

@@ -25,11 +25,11 @@ @http_injectors = nil @text_map_extractors = nil @text_map_injectors = nil @span_processors = [] @use_mode = USE_MODE_UNSPECIFIED - @resource = Resources::Resource.telemetry_sdk + @resource = Resources::Resource.default @id_generator = OpenTelemetry::Trace end def logger @logger ||= OpenTelemetry.logger @@ -44,30 +44,30 @@ # to include additional resource information. # If a resource key collision occurs the passed in resource takes priority. # # @param [Resource] new_resource The resource to be merged def resource=(new_resource) - @resource = new_resource.merge(@resource) + @resource = @resource.merge(new_resource) end # Accepts a string that is merged in as the service.name resource attribute. # The most recent assigned value will be used in the event of repeated # calls to this setter. # @param [String] service_name The value to be used as the service name def service_name=(service_name) - @resource = OpenTelemetry::SDK::Resources::Resource.create( + self.resource = OpenTelemetry::SDK::Resources::Resource.create( OpenTelemetry::SDK::Resources::Constants::SERVICE_RESOURCE[:name] => service_name - ).merge(@resource) + ) end # Accepts a string that is merged in as the service.version resource attribute. # The most recent assigned value will be used in the event of repeated # calls to this setter. # @param [String] service_version The value to be used as the service version def service_version=(service_version) - @resource = OpenTelemetry::SDK::Resources::Resource.create( + self.resource = OpenTelemetry::SDK::Resources::Resource.create( OpenTelemetry::SDK::Resources::Constants::SERVICE_RESOURCE[:version] => service_version - ).merge(@resource) + ) end # Install an instrumentation with specificied optional +config+. # Use can be called multiple times to install multiple instrumentation. # Only +use+ or +use_all+, but not both when installing