Logging and Monitoring in Athena - Amazon Athena

Logging and Monitoring in Athena

To detect incidents, receive alerts when incidents occur, and respond to them, use these options with Amazon Athena:

  • Monitor Athena with AWS CloudTrailAWS CloudTrail provides a record of actions taken by a user, role, or an AWS service in Athena. It captures calls from the Athena console and code calls to the Athena API operations as events. This allow you to determine the request that was made to Athena, the IP address from which the request was made, who made the request, when it was made, and additional details. You can also use Athena to query CloudTrail log files for insight. For more information, see Querying AWS CloudTrail Logs and CloudTrail SerDe.

  • Use CloudWatch Events with Athena – CloudWatch Events delivers a near real-time stream of system events that describe changes in AWS resources. CloudWatch Events becomes aware of operational changes as they occur, responds to them, and takes corrective action as necessary, by sending messages to respond to the environment, activating functions, making changes, and capturing state information. To use CloudWatch Events with Athena, create a rule that triggers on an Athena API call via CloudTrail. For more information, see Creating a CloudWatch Events Rule That Triggers on an AWS API Call Using CloudTrail in the Amazon CloudWatch Events User Guide.

  • Use workgroups to separate users, teams, applications, or workloads, and to set query limits and control query costs – You can view query-related metrics in Amazon CloudWatch, control query costs by configuring limits on the amount of data scanned, create thresholds, and trigger actions, such as Amazon SNS alarms, when these thresholds are breached. For a high-level procedure, see Setting up Workgroups. Use resource-level IAM permissions to control access to a specific workgroup. For more information, see Using Workgroups for Running Queries and Controlling Costs and Monitoring Queries with CloudWatch Metrics and Events.