APC uses Vector for log collection and forwarding. You can configure Vector to send Airflow task logs to Amazon S3 for long-term storage, compliance, or integration with other analytics tools.Documentation Index
Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
If you previously configured S3 log forwarding using Fluentd in APC 0.37 or earlier, you must replace your
fluentd.s3 configuration with the Vector extraSinks configuration described in this document. Fluentd is no longer used for log collection in APC 1.0.Architecture
Vector continues forwarding logs to Elasticsearch for the Airflow UI while also sending copies to S3.The logs forwarded to S3 are Airflow task logs and deployment logs, not APC platform logs from Houston, Commander, or Registry.
Prerequisites
- An existing S3 bucket
- AWS IAM credentials with S3 write access
- APC 1.0 or later
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::your-logs-bucket"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject"
],
"Resource": "arn:aws:s3:::your-logs-bucket/*"
}
]
}
For more information on S3 permissions, see Amazon S3 actions.
IRSA (Recommended)
For EKS clusters, use IAM Roles for Service Accounts (IRSA) to securely provide AWS credentials:
- Create an IAM role with the S3 policy attached
- Configure the trust relationship for the Vector service account:
- Annotate the Vector service account in your
values.yaml:
EC2 instance profile
For self-managed Kubernetes on EC2, attach the IAM policy to the EC2 instance profile used by your worker nodes.
Static credentials
For non-AWS environments or testing, use static credentials:Create the secret:
vector:
extraSinks:
s3_logs:
type: aws_s3
inputs:
- transform_remove_fields
bucket: "your-logs-bucket"
region: "us-east-1"
key_prefix: "airflow-logs/{{ "{{ namespace }}" }}/{{ "{{ release }}" }}/%Y/%m/%d/"
compression: gzip
encoding:
codec: json
batch:
max_bytes: 10485760
timeout_secs: 300
request:
retry_attempts: 5
For a full list of available options, see the Vector
aws_s3 sink configuration reference.bucketmy-logs-bucketregionus-east-1key_prefixlogs/%Y/%m/%d/compressiongzip, zstd, noneencoding.codecjson, text, ndjsonbatch.max_bytes10485760 (10MB)batch.timeout_secs300 (5 minutes){{ "{{ namespace }}" }}{{ "{{ release }}" }}%Y, %m, %d%H, %M, %SPush the configuration to your APC installation. For detailed instructions, see Apply a config change.
Advanced configuration
Filter logs by severity
Only forward ERROR and WARNING logs to S3 using a VRL filter condition:Partition by deployment
Organize logs by deployment namespace:Multiple destinations
Forward to both S3 and another system:S3 lifecycle policies
Configure S3 lifecycle rules to manage log retention:Troubleshooting
Logs not appearing in S3
-
Check Vector pod logs:
-
Verify AWS credentials:
-
Inspect the logs for credential errors or permission issues.
Look for lines containing
CredentialsNotLoaded(no credentials found) orInvalid credentials(credentials rejected by AWS). For example:To see which credentials Vector loaded, look for lines matchingaws_config::profile::credentials:These lines show the access key ID in use, which can help confirm whether the correct credentials are being picked up.
Permission denied errors
Verify your IAM policy includes boths3:PutObject and s3:ListBucket permissions. The bucket resource ARN should not include /* for ListBucket.