Amazon Athena
This has not been tested, and has been written to an API spec and examples found.
When integrating Amazon Athena as a data source, you’ll be using an ODBC connection. This requires installing Amazon’s official Athena ODBC driver on your server.
Download the driver:
Amazon Athena ODBC Driver Downloads
Athena queries run serverless, and query results are stored in an S3 bucket, which must be properly configured with the necessary permissions.
Here’s an example configuration:
[example_athena]
source = AwsDataCatalog
region = eu-west-2
workgroup = primary
output = s3://your-output-bucket/
type = athena
identifier = athena_endpoint
query = <The query to run>
aws_access_key_id = YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key = YOUR_AWS_SECRET_ACCESS_KEY
Breakdown of Configuration Fields
-
[example_athena]
Profile name for this specific Athena data source. Arbitrary, used internally. -
source
Defines the data catalog to use. Typically, this will beAwsDataCatalog
for most Athena setups, but it can vary if using custom Glue Data Catalogs. -
region
The AWS region where your Athena service is hosted.
Example:eu-west-2
for London. -
workgroup
Specifies the Athena workgroup to use.
Example:primary
. -
output
The S3 bucket location where query results will be stored.
Example:s3://your-output-bucket/
.
Ensure this bucket has the correct permissions (see S3 Bucket Permissions below). -
type
Defines the data source type. For Athena, this is set toathena
. -
identifier
Determines the URL segment for accessing metrics from this Athena data source.
Withidentifier = athena_endpoint
, metrics will be available at:http://<YOUR_HOST>/athena_endpoint/prometheus
-
query
The query to be executed via Athena. -
aws_access_key_id
Your AWS Access Key ID.
Note: Only required if your server does not have an IAM role configured. -
aws_secret_access_key
Your AWS Secret Access Key.
Note: Only required if your server does not have an IAM role configured.
S3 Bucket Permissions
Athena requires an S3 bucket to store query results. Ensure the following policy is attached to the user or role performing the queries:
{
\"Version\": \"2012-10-17\",
\"Statement\": [
{
\"Action\": [
\"athena:*\",
\"s3:GetObject\",
\"s3:PutObject\",
\"s3:ListBucket\",
\"glue:*\" // optional, if you’re using Glue Data Catalog
],
\"Effect\": \"Allow\",
\"Resource\": \"*\"
}
]
}
This grants necessary permissions for Athena operations, S3 interactions, and optionally Glue, if your data catalog is stored there.