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. For more information, see Logging Amazon Athena API Calls with AWS CloudTrail.

    You can also use Athena to query the CloudTrail log files not only for Athena, but for other AWS services. For more information, see Querying AWS CloudTrail Logs and CloudTrail SerDe.

  • Monitor Athena usage with CloudTrail and Amazon QuickSightAmazon QuickSight is a fully managed, cloud-powered business intelligence service that lets you create interactive dashboards your organization can access from any device. For an example of a solution that uses CloudTrail and Amazon QuickSight to monitor Athena usage, see the AWS Big Data blog post How Realtor.com Monitors Amazon Athena Usage with AWS CloudTrail and Amazon QuickSight.

  • 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. Events are emitted on a best effort basis. 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.