Hi all, I'm having some trouble with the adding Cl...
# flyte-support
n
Hi all, I'm having some trouble with the adding Cloudwatch logging to my tasks. Here is what I've done: 1. I updated my helm chart with the following:
Copy code
logging:
    level: 20
    plugins:
      cloudwatch:
        enabled: true
        templateUri: |-
          <https://console.aws.amazon.com/cloudwatch/home?region=us-west-1#logEventViewer:group=/aws/eks/flyte-eks-cluster/cluster;stream=var.log.containers.{{> .podName }}_{{ .namespace }}_{{ .containerName }}-{{ .containerId }}.log
2. When I click on Logs, "Cloudwatch Logs (User)" on the console, it takes me to AWS Cloudwatch, but it has an error at the top: "The specified log stream does not exist". Note, the log group exists. Some things I've done to debug - none of which have worked so far. • I see the logs for a pod successfully when I directly look at
kubectl log <PODNAME>
• I simplified the
templateUri
to
...var.log.containers.{{ .namespace }}.log
, and manually created the log stream. In this scenario, when I click on the "Cloudwatch Logs (User)" link, I don't get the error anymore, but there is nothing in the log stream (even though there is something in
kubectl log
. • I updated my flyte-IAM-policy to also include:
Copy code
{
  "Effect": "Allow",
  "Action": [
    "logs:CreateLogGroup",
    "logs:CreateLogStream",
    "logs:PutLogEvents",
    "logs:DescribeLogStreams"
  ],
  "Resource": [
    "arn:aws:logs:*:*:*"
  ]
}
Any suggestions? Thank you!
I think I misunderstood what the config change actually does. Please correct me if I'm wrong, but I think I was able to get logging to work. To turn on logging, I added on CloudWatch Container Insights within EKS. This led to getting the outputs being sent to
/aws/containerinsights/flyte-eks-cluster/application
log group. I then had to update the templateUri field in the helm chart to match this. If I understand correctly, the templateUri is simply updating the link for "Cloudwatch Logs (User)", but doesn't actually control where the stream goes. Anyways, would love to get more insight if anyone cares to instruct me, but things are working for now.
f
you are right
interesting to know about the container insights