question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Log Links should work with CloudWatch FluentD Out Of the Box

See original GitHub issue

Describe the bug

As it stands, users wishing to enable CloudWatch logs will need to go through the AWS Process to do so here and then manually modify the fluent-bit-config configmap to alter the generated log stream to match what Flyte expects.

kubectl edit cm -n amazon-cloudwatch fluent-bit-config 
[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

And then use this configmap for flyte:

  task_logs.yaml: |
    plugins:
      logs:
        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 }}'

We should change the default template defined here to be: https://console.aws.amazon.com/cloudwatch/home?region=%s#logsV2:log-groups/log-group/%s$3FlogStreamNameFilter=var.log.containers.{{ .podName }}_{{ .namespace }}_{{ .containerName }}

Expected behavior

  1. Follow AWS Guide to deploy FluentD: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs-FluentBit.html
  2. Enable CloudWatch logs in Flyte:
      task_logs.yaml: |
        plugins:
          logs:
            cloudwatch-enabled: true
            cloudwatch-log-group: 'bv-ml-pipelines'
            cloudwatch-region: 'us-east-1'
            kubernetes-enabled: false
    
  3. SUCCESS ✔️

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn’t been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Azanulcommented, Oct 2, 2022
0reactions
EngHabucommented, Nov 26, 2022

Aha, I understand, I agree changing the default can break other people, do you know for a fact that FlutentBit in compatibility mode works out of the box? I vaguely recall hostname was still a requirement though, no?

Perhaps a better approach is to:

  1. Still add support for a host name template parameter
  2. Instead of changing the default, add another CloudWatchV2Enabled flag that default to the new version format…
  3. Add a “Enabling Cloud Provider-Native logs” where we can elaborate on templating for URLs, StackDriver, CloudWatch, FluentD and FluentBit.
Read more comments on GitHub >

github_iconTop Results From Across the Web

(Optional) Set up FluentD as a DaemonSet to send logs to ...
By default, we send FluentD application logs and Kubernetes metadata to CloudWatch. If you want to reduce the volume of data being sent...
Read more >
Cluster-level Logging in Kubernetes with Fluentd - Medium
Logs are crucial to help you understand what is happening inside your Kubernetes cluster. Even though most applications have some kind of ...
Read more >
Fluentd on Kubernetes: Log collection explained - YouTube
We take a look at the fluentd dockerfile, how to run it on each ... Finally we see how to ship the collected...
Read more >
How to Collect Metrics and Logs From AWS Fargate Workloads
To send logs from any ECS task to CloudWatch using Fluent Bit, create a Fluent Bit container in your task that will route...
Read more >
OpenShift Container Platform 4.9 Logging
Fluentd log handling when the external log aggregator is unavailable ... Cloudwatch stream with multi-line error detection enabled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found