lib/service.js
function apiCallEvent(request) {
    var api = request.service.api.operations[request.operation];
    var monitoringEvent = {
      Type: 'ApiCall',
      Api: api ? api.name : request.operation,
      Version: 1,
      Service: request.service.api.serviceId || request.service.api.endpointPrefix,
      Region: request.httpRequest.region,
      MaxRetriesExceeded: 0,
      UserAgent: request.httpRequest.getUserAgent(),
    };
    var response = request.response;
    if (response.httpResponse.statusCode) {
      monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode;
    }
    if (response.error) {
      var error = response.error;
      var statusCode = response.httpResponse.statusCode;
      if (statusCode > 299) {
        if (error.code) monitoringEvent.FinalAwsException = error.code;
        if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message;
      } else {
        if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name;
        if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message;
      }
    }
    return monitoringEvent;
  }
function apiCallEvent(request) {
    var api = request.service.api.operations[request.operation];
    var monitoringEvent = {
      Type: 'ApiCall',
      Api: api ? api.name : request.operation,
      Version: 1,
      Service: request.service.api.serviceId || request.service.api.endpointPrefix,
      Region: request.httpRequest.region,
      MaxRetriesExceeded: 0,
      UserAgent: request.httpRequest.getUserAgent(),
    };
    var response = request.response;
    if (response.httpResponse.statusCode) {
      monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode;
    }
    if (response.error) {
      var error = response.error;
      var statusCode = response.httpResponse.statusCode;
      if (statusCode > 299) {
        if (error.code) monitoringEvent.FinalAwsException = error.code;
        if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message;
      } else {
        if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name;
        if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message;
      }
    }
    return monitoringEvent;
  }
function apiCallEvent ( request ) { var api = request . service . api . operations [ request . operation ] ; var monitoringEvent = { Type : 'ApiCall' , Api : api ? api . name : request . operation , Version : 1 , Service : request . service . api . serviceId || request . service . api . endpointPrefix , Region : request . httpRequest . region , MaxRetriesExceeded : 0 , UserAgent : request . httpRequest . getUserAgent ( ) , } ; var response = request . response ; if ( response . httpResponse . statusCode ) { monitoringEvent . FinalHttpStatusCode = response . httpResponse . statusCode ; } if ( response . error ) { var error = response . error ; var statusCode = response . httpResponse . statusCode ; if ( statusCode > 299 ) { if ( error . code ) monitoringEvent . FinalAwsException = error . code ; if ( error . message ) monitoringEvent . FinalAwsExceptionMessage = error . message ; } else { if ( error . code || error . name ) monitoringEvent . FinalSdkException = error . code || error . name ; if ( error . message ) monitoringEvent . FinalSdkExceptionMessage = error . message ; } } return monitoringEvent ; }
Event recording metrics for a whole API call.
@returns {object} a subset of api call metrics
@api private
Event recording metrics for a whole API call .