listAuditFindings method

Future<ListAuditFindingsOutput> listAuditFindings({
  1. required List<AuditTarget> auditTargets,
  2. required DateTime endTime,
  3. required DateTime startTime,
  4. List<String>? auditors,
  5. DetailLevel? detailLevel,
  6. int? maxResults,
  7. String? nextToken,
})

Returns a list of audit findings that provide automated analysis of service behavior and root cause analysis. These findings help identify the most significant observations about your services, including performance issues, anomalies, and potential problems. The findings are generated using heuristic algorithms based on established troubleshooting patterns.

May throw ThrottlingException. May throw ValidationException.

Parameter auditTargets : A list of audit targets to filter the findings by. You can specify services, SLOs, or service operations to limit the audit findings to specific entities.

Parameter endTime : The end of the time period to retrieve audit findings for. When used in a raw HTTP Query API, it is formatted as epoch time in seconds. For example, 1698778057

Parameter startTime : The start of the time period to retrieve audit findings for. When used in a raw HTTP Query API, it is formatted as epoch time in seconds. For example, 1698778057

Parameter auditors : A list of auditor names to filter the findings by. Only findings generated by the specified auditors will be returned.

The following auditors are available for configuration:

  • slo - SloAuditor: Identifies SLO violations and detects breached thresholds during the Assessment phase.
  • operation_metric - OperationMetricAuditor: Detects anomalies in service operation metrics from Application Signals RED metrics during the Assessment phase
  • service_quota - ServiceQuotaAuditor: Monitors resource utilization against service quotas during the Assessment phase
  • trace - TraceAuditor: Performs deep-dive analysis of distributed traces, correlating traces with breached SLOs or abnormal RED metrics during the Analysis phase
  • dependency_metric - CriticalPathAuditor: Analyzes service dependency impacts and maps dependency relationships from Application Signals RED metrics during the Analysis phase
  • top_contributor - TopContributorAuditor: Identifies infrastructure-level contributors to issues by analyzing EMF logs of Application Signals RED metrics during the Analysis phase
  • log - LogAuditor: Extracts insights from application logs, categorizing error types and ranking severity by frequency during the Analysis phase
  • change_indicator - ChangeIndicatorAuditor: Detects change events (deployments, configuration changes) that occurred within 10 minutes before and during a detected anomaly, and surfaces them as findings with deployment timestamps in the Analysis phase. When changes are detected, the top_contributor auditor skips its analysis to avoid redundancy.

Parameter detailLevel : The level of details of the audit findings. Supported values: BRIEF, DETAILED.

Parameter maxResults : The maximum number of audit findings to return in one operation. If you omit this parameter, the default of 10 is used.

Parameter nextToken : Include this value, if it was returned by the previous operation, to get the next set of audit findings.

Implementation

Future<ListAuditFindingsOutput> listAuditFindings({
  required List<AuditTarget> auditTargets,
  required DateTime endTime,
  required DateTime startTime,
  List<String>? auditors,
  DetailLevel? detailLevel,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  final $query = <String, List<String>>{
    'EndTime': [_s.iso8601ToJson(endTime).toString()],
    'StartTime': [_s.iso8601ToJson(startTime).toString()],
  };
  final $payload = <String, dynamic>{
    'AuditTargets': auditTargets,
    if (auditors != null) 'Auditors': auditors,
    if (detailLevel != null) 'DetailLevel': detailLevel.value,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/auditFindings',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListAuditFindingsOutput.fromJson(response);
}