Amazon Athena is a serverless, interactive analytics service that provides a simplified and flexible way to analyze petabytes of data where it lives. It is an important tool for analyzing existing data. AppDynamics is one of the best monitoring solutions that gives you insight into applications and infrastructure. Let’s dive into our setup.
Prerequisites
- Machine Agent installed on any Linux box
- The Linux box should have permission to fetch CloudWatch metrics
Setting up Amazon Athena
Set up Amazon Athena
If you all have Athena set up, then scroll down. If not, follow the below steps:
- Create an S3 bucket where we will save Athena query results. I created one called “athena-query-result-abhi”
Enable Amazon Athena to publish query metrics to AWS CloudWatch
- Edit the WorkGroup your Amazon Athena is part of and select “Publish query metrics to AWS CloudWatch”
Running the Sample Queries
In the Athena console, run the following queries to create a sample database and table:
- Create the Database:
CREATE DATABASE sampledb;
- Create a Sample Table with some inline data:
CREATE TABLE sampledb.sampletable AS SELECT 'value1' AS col1, 'value2' AS col2, 'value3' AS col3 UNION ALL SELECT 'value4' AS col1, 'value5' AS col2, 'value6' AS col3;
- Run a Sample Query to generate activity:
SELECT * FROM sampledb.sampletable LIMIT 10;
Running Queries to Generate Metrics:
- Execute the following queries to generate sufficient activity and metrics:
SELECT * FROM sampledb.sampletable LIMIT 10; SELECT col1, COUNT(*) FROM sampledb.sampletable GROUP BY col1; SELECT COUNT(*) FROM sampledb.sampletable WHERE col2 = 'value2'; SELECT col1, col2 FROM sampledb.sampletable WHERE col3 = 'value3';
- Great work, your Athena is all set up