class Aws::Plugins::Telemetry::Handler

def call(context)

def call(context)
  span_wrapper(context) { @handler.call(context) }
end

def parent_span_name(context, service_id)

def parent_span_name(context, service_id)
  "#{service_id}.#{context.operation.name}".delete(' ')
end

def service_id(context)

def service_id(context)
  context.config.api.metadata['serviceId'] ||
    context.config.api.metadata['serviceAbbreviation'] ||
    context.config.api.metadata['serviceFullName']
end

def span_wrapper(context, &block)

def span_wrapper(context, &block)
  service_id = service_id(context)
  attributes = {
    'rpc.system' => 'aws-api',
    'rpc.service' => service_id,
    'rpc.method' => context.operation.name,
    'code.function' => context.operation_name.to_s,
    'code.namespace' => 'Aws::Plugins::Telemetry'
  }
  context.tracer.in_span(
    parent_span_name(context, service_id),
    attributes: attributes,
    kind: Aws::Telemetry::SpanKind::CLIENT,
    &block
  )
end