# frozen_string_literal: truemoduleAwsmoduleTelemetry# Base for `TelemetryProvider` classes.# They are used to emit telemetry data. It needs the# following class implementations to function:# * {TracerProviderBase} - A provider that returns a tracer# instance. Then, a tracer will create spans and those# spans will contain information in that given moment.# * {ContextManagerBase} - Manages context and used to# return the current context within a trace.classTelemetryProviderBase# @param [Aws::Telemetry::TracerBase] tracer_provider A provider# that returns a tracer instance.# @param [Aws::Telemetry::ContextManagerBase] context_manager Manages# context and used to return the current context.definitialize(tracer_provider: nil,context_manager: nil)@tracer_provider=tracer_provider@context_manager=context_managerend# @return [Aws::Telemetry::TracerProviderBase]attr_reader:tracer_provider# @return [Aws::Telemetry::ContextManagerBase]attr_reader:context_managerend# Base for `TracerProvider` classes.classTracerProviderBase# Returns a Tracer instance.## @param [String] name Tracer name# @return [Aws::Telemetry::TracerBase]deftracer(name=nil)raiseNotImplementedErrorendend# Base for `Tracer` classes.classTracerBase# Used when a caller wants to manage the activation/deactivation and# lifecycle of the Span and its parent manually.## @param [String] name Span name# @param [Object] with_parent Parent Context# @param [Hash] attributes Attributes to attach to the span# @param [Aws::Telemetry::SpanKind] kind Type of Span# @return [Aws::Telemetry::SpanBase]defstart_span(name,with_parent: nil,attributes: nil,kind: nil)raiseNotImplementedErrorend# A helper for the default use-case of extending the current trace# with a span.# On exit, the Span that was active before calling this method will# be reactivated. If an exception occurs during the execution of the# provided block, it will be recorded on the span and re-raised.## @param [String] name Span name# @param [Hash] attributes Attributes to attach to the span# @param [Aws::Telemetry::SpanKind] kind Type of Span# @return [Aws::Telemetry::SpanBase]defin_span(name,attributes: nil,kind: nil)raiseNotImplementedErrorend# Returns the current active span.## @return [Aws::Telemetry::SpanBase]defcurrent_spanraiseNotImplementedErrorendend# Base for `Span` classes.classSpanBase# Set attribute.## @param [String] key# @param [String, Boolean, Numeric, Array<String, Numeric, Boolean>] value# Value must be non-nil and (array of) string, boolean or numeric type.# Array values must not contain nil elements and all elements must be of# the same basic type (string, numeric, boolean)# @return [self] returns itselfdefset_attribute(key,value)raiseNotImplementedErrorendalias[]=set_attribute# Add attributes.## @param [Hash{String => String, Numeric, Boolean, Array<String, Numeric,# Boolean>}] attributes Values must be non-nil and (array of) string,# boolean or numeric type. Array values must not contain nil elements# and all elements must be of the same basic type (string, numeric,# boolean)# @return [self] returns itselfdefadd_attributes(attributes)raiseNotImplementedErrorend# Add event to a Span.## @param [String] name Name of the event# @param [Hash{String => String, Numeric, Boolean, Array<String,# Numeric, Boolean>}] attributes Values must be non-nil and (array of)# string, boolean or numeric type. Array values must not contain nil# elements and all elements must be of the same basic type (string,# numeric, boolean)# @return [self] returns itselfdefadd_event(name,attributes: nil)raiseNotImplementedErrorend# Sets the Span status.## @param [Aws::Telemetry::SpanStatus] status The new status, which# overrides the default Span status, which is `OK`# @return [void]defstatus=(status)raiseNotImplementedErrorend# Finishes the Span.## @param [Time] end_timestamp End timestamp for the span.# @return [self] returns itselfdeffinish(end_timestamp: nil)raiseNotImplementedErrorend# Record an exception during the execution of this span. Multiple# exceptions can be recorded on a span.## @param [Exception] exception The exception to be recorded# @param [Hash{String => String, Numeric, Boolean, Array<String,# Numeric, Boolean>}] attributes One or more key:value pairs, where the# keys must be strings and the values may be (array of) string, boolean# or numeric type.# @return [void]defrecord_exception(exception,attributes: nil)raiseNotImplementedErrorendend# Base for all `ContextManager` classes.classContextManagerBase# Returns current context.## @return [Context]defcurrentraiseNotImplementedErrorend# Associates a Context with the caller’s current execution unit.# Returns a token to be used with the matching call to detach.## @param [Object] context The new context# @return [Object] token A token to be used when detachingdefattach(context)raiseNotImplementedErrorend# Restore the previous Context associated with the current# execution unit to the value it had before attaching a# specified Context.## @param [Object] token The token provided by matching the call to attach# @return [Boolean] `True` if the calls matched, `False` otherwisedefdetach(token)raiseNotImplementedErrorendendendend