Forward logs to Amazon S3
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.
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
Configure AWS IAM
Create IAM policy
Create an IAM policy with S3 write permissions:
For more information on S3 permissions, see Amazon S3 actions.
Provide credentials to Vector
IRSA (Recommended)
EC2 instance profile
Static credentials
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:
Configure Vector S3 sink
Add the S3 sink to your values.yaml:
Configuration options
For a full list of available options, see the Vector aws_s3 sink configuration reference.
Key prefix templating
Use template variables in key_prefix:
Example: airflow-logs/{{ "{{ namespace }}" }}/%Y/%m/%d/%H/
Apply configuration
Push the configuration to your APC installation. For detailed instructions, see Apply a config change.
Verify Vector pods restart with the new configuration:
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:
Apply via AWS CLI:
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 matching
aws_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 both s3:PutObject and s3:ListBucket permissions. The bucket resource ARN should not include /* for ListBucket.
High latency
Adjust batch settings for faster delivery: