lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.6.0 vs lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.7.0

- old
+ new

@@ -42,10 +42,30 @@ # @param [Resource] new_resource The resource to be merged def resource=(new_resource) @resource = new_resource.merge(@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( + 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( + 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 # instrumentation. A call to +use_all+ after +use+ will result in an # exception. @@ -71,11 +91,11 @@ @instrumentation_config_map = instrumentation_config_map end # Add a span processor to the export pipeline # - # @param [#on_start, #on_finish, #shutdown] span_processor A span_processor - # that satisfies the duck type #on_start, #on_finish, #shutdown. See + # @param [#on_start, #on_finish, #shutdown, #force_flush] span_processor A span_processor + # that satisfies the duck type #on_start, #on_finish, #shutdown, #force_flush. See # {SimpleSpanProcessor} for an example. def add_span_processor(span_processor) @span_processors << span_processor end