Skip to main content

Show Remote Execution Agent task logs in Airflow UI

You can make task logs visible directly in the Airflow UI by exporting task logs to your object storage, and configuring the Astro API Server to securely retrieve them.

This requires:

  • Configuration in the Remote Execution Agent's Helm values.yaml.
  • Deployment configuration in the Astro UI.
  • Proper workload identities for the Remote Execution Agent, write access, and the Astro API Server, read access.
AWS

To display task logs directly in the Airflow UI for your Remote Execution Deployment, you must store the task logs in an S3 bucket located in the same region as the Deployment's cluster.

  1. Configure the following environment variables in the Helm chart's values.yaml, and replace the path for the AIRFLOW__LOGGING__REMOTE_BASE_LOG_FOLDER value with your information:
commonEnv:
- name: AIRFLOW__LOGGING__REMOTE_LOGGING
value: "True"
- name: AIRFLOW__LOGGING__REMOTE_LOG_CONN_ID
value: "astro_aws_logging"
- name: AIRFLOW_CONN_ASTRO_AWS_LOGGING
value: "s3://"
- name: AIRFLOW__LOGGING__REMOTE_BASE_LOG_FOLDER
value: "s3://<bucket>/<deployment-id>"
- name: AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS
value: "astronomer.runtime.logging.logging_config"
- name: ASTRONOMER_ENVIRONMENT
value: "cloud"
Mounting credentials manually

If you do not use workload identity and instead want to manually mount a credential, you must also add the following environment variable defining the location of a token file to your Remote Agent's values.yaml file. You can customize the file path, /tmp/logging-token, to the name of your logging token file.

  - name: ASTRO_LOGGING_AWS_WEB_IDENTITY_TOKEN_FILE
value: "/tmp/logging-token"
  1. Run helm upgrade to apply the change to your Agents.

  2. In the Astro UI, navigate to your Deployment and click the Details tab. Click Edit in the Advanced section to access your logging configurations.

  3. Select Bucket Storage in the Task Logs field and fill in the Bucket URL as s3://<bucket>/<deployment-id>. Or, use the path that you configured for AIRFLOW__LOGGING__REMOTE_BASE_LOG_FOLDER in your Remote Agent's Helm chart's values.yaml.

  4. In the Workload Identity for Bucket Storage section, select Customer Managed Identity and follow the instructions to set up your Customer Managed Identity so that the identity you create has read access to the specified bucket and path.

  5. (Optional) If your log bucket is in a different region from your Astro Deployment, you need to define the AWS region in the AIRFLOW__ASTRONOMER_PROVIDERS_LOGGING__AWS_REGION environment variable for Astronomer-managed components. In the Astro UI, navigate to your Deployment and click the Environment tab. Click Environment Variables, then click (+) Environment Variable to add the following environment variables to your Deployment:

  • AIRFLOW__ASTRONOMER_PROVIDERS_LOGGING__AWS_REGION <The region in which the S3 bucket is configured>

Was this page helpful?