<@U06RKAMK0UC> how do I configure logging?
# runllm-flyte-trial
s
@ancient-wolf-19325 how do I configure logging?
j
To configure logging in Flyte, you can adjust the logging level and set up log providers. Use the
FLYTE_SDK_LOGGING_LEVEL
environment variable to set the log level, which determines the minimum severity of logs to be captured. For example, setting it to
20
will capture logs at the
INFO
level and above. For configuring log providers, Flyte allows you to set up URLs for log aggregators like AWS CloudWatch or GCP Stackdriver. This is done by specifying templated URIs in the
task_logs
configuration. You can find more details on configuring logging links in the Flyte UI in the Flyte documentation. Would you like more detail on any specific part of the logging configuration process? Sources: - Configuring logging links in the UI - Flyte GitHub Issue #4830 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@ancient-wolf-19325, yes show me how to configure for AWS Cloudwatch
j
To configure Flyte for AWS CloudWatch logging, you need to set up the
task_logs
configuration in your Flyte deployment. This involves enabling CloudWatch and specifying the log group and region. Here's a basic example: 1. Enable CloudWatch Logging: Set
cloudwatch-enabled
to
true
. 2. Specify CloudWatch Region and Log Group: Define the
cloudwatch-region
and
cloudwatch-log-group
in your configuration. Here's a sample configuration in YAML format:
Copy code
task_logs:
  plugins:
    logs:
      cloudwatch-enabled: true
      cloudwatch-region: "us-east-1"
      cloudwatch-log-group: "/aws/eks/your-log-group"
Ensure that your Kubernetes cluster is configured to send logs to CloudWatch, typically using FluentD or FluentBit. You may need to adjust IAM roles to allow writing to CloudWatch. Would you like more detailed steps or information on setting up FluentD or FluentBit? Sources: - Configuring logging links in the UI - Flyte GitHub Issue #2635 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@ancient-wolf-19325, yes with FluentBit
j
To configure Flyte with FluentBit for AWS CloudWatch logging, follow these steps: 1. Deploy FluentBit: Install FluentBit on your Kubernetes cluster. Follow the AWS guide for setting up FluentBit with CloudWatch, which includes creating a ConfigMap for FluentBit configuration. 2. Configure FluentBit: Edit the FluentBit configuration to match Flyte's expected log stream format. You can do this by modifying the
fluent-bit-config
ConfigMap:
Copy code
kubectl edit cm -n amazon-cloudwatch fluent-bit-config
Update the configuration to include:
Copy code
[OUTPUT]
       Name                cloudwatch_logs
       Match               application.*
       region              ${AWS_REGION}
       log_group_name      /aws/containerinsights/${CLUSTER_NAME}/application
       log_stream_prefix   var.
       auto_create_group   true
       extra_user_agent    container-insights
3. Configure Flyte: Update the Flyte
task_logs
configuration to enable CloudWatch logging and specify the template URI:
Copy code
task_logs:
     plugins:
       logs:
         cloudwatch-enabled: true
         cloudwatch-region: "us-east-1"
         cloudwatch-log-group: "/aws/containerinsights/your-cluster-name/application"
         cloudwatch-template-uri: 'https://{vars.region}.console.aws.amazon.com/cloudwatch/home?region={vars.region}#logsV2:log-groups/log-group/$252Faws$252Fcontainerinsights$252F<log group name>$252Fapplication$3FlogStreamNameFilter$3Dvar.application.var.log.containers.{{ .podName }}_{{ .namespace }}_{{ .containerName }}'
Ensure that your IAM roles have the necessary permissions to write logs to CloudWatch. Would you like more detailed guidance on any of these steps? Sources: - GitHub Issue #2635 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
a
@salmon-flower-36598 also check out how we do it in the AWS reference implementation: https://github.com/unionai-oss/deploy-flyte/tree/main/environments/aws/flyte-core And please use either the #CP2HDHKE1 or #C06H1SFA19R channels. We try to keep this one as "backstage"