If you’re running Astronomer Software and are interested in making Airflow task logs available in an Amazon S3 bucket, you’re more than free to do so on the platform. For context, Astronomer Software leverages Fluentd as a data collector that is responsible for scraping and cleaning Airflow task logs to then send to Elasticsearch, a search engine used to centralize and index logs from Airflow. The Airflow webserver pulls from Elasticsearch to render those logs directly to the user in the Airflow UI. The guidelines below will outline how to forward Airflow logs from Fluentd via an existing Fluentd to S3 plugin. For more information on the plugin itself, reference the following: Fluentd will continue to forward logs to Elasticsearch in addition to the destination you additionally configure, so we strongly recommend keeping the Elasticsearch output.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.
The logs in question in this doc are Airflow logs, NOT Astronomer platform logs from Houston, the Registry, etc. They’re the equivalent of deployment-level logs exposed in the ‘Logs’ tab of the Software UI and task logs rendered in the Airflow UI.
Prerequisites
To configure log forwarding from Fluentd to Amazon S3, you’ll need:- An existing S3 Bucket
- An EKS worker node autoscaling policy
Configure IAM policy and role
1. Create an AWS IAM policy with the following permissions The first step in configuring Airflow task logs to be forwarded to Amazon S3 is to create an IAM policy on AWS and grant it the following 3 roles:s3:ListBuckets3:PutObjects3:GetObject
Configure EKS worker node policy
1. Allow your EKS nodes to assume your new IAM role Find your EKS worker node autoscaling policy for your EKS cluster. The policyarn should look like: arn:aws:iam::123456789:policy/eks-worker-autoscaling-astronomer-5dyw2O4d20200730104135818400000008.
Add the following section to the policy:
Enable Fluentd to S3 in your values.yaml file
In yourvalues.yaml file, add the following values: