docs: def extract_http_metadata(wrapped, instance, args, kwargs, return_value):
      """Provide HTTP request metadata for improved visualization.
  
      See documentation for this data structure:
      http://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-http
      """
      response = return_value
      LOGGER.debug(
          'Extracting HTTP metadata',
          args=args,
          kwargs=kwargs,
      )
      if 'request' in kwargs:
          request = kwargs['request']
      else:
          request = args[0]
  
      metadata = {
          'http': {
              'request': {
                  'method': request.method.upper(),
                  'url': request.url,
              },
          },
      }
      if response is not None:
          metadata['http']['response'] = {
              'status': response.status_code,
          }
  
      return metadata