:wave: quick cloudwatch plugin question -- I've tu...
# flyte-support
g
đź‘‹ quick cloudwatch plugin question -- I've turn on the cloudwatch container insights plugin (it's an addon from EKS, fairly simple to turn on) -- I've changed the logging template URL to match the new pattern that cloudwatch is expecting but I'm confused by what I'm seeing:
Copy code
<https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group=/aws/containerinsights/prod-next-datologyai-k8s/application;stream={{> .hostname }}.var.log.containers.{{ .podName }}_{{ .namespace }}_{{ .containerName }}-{{ .containerId }}.log
Based on the docs hostname should be something supported as a template flag https://docs.flyte.org/en/latest/user_guide/productionizing/configuring_logging_links_in_the_ui.html#configure-logging -- but in practice this is the URL that flyte generates:
Copy code
{{ .hostname }}.var.log.containers.f391c9f2cc04b4f4eb42-n1-0-dn8-0-dn1-0-dn1-0_datology-development_f391c9f2cc04b4f4eb42-n1-0-dn8-0-dn1-0-dn1-0-e8b24149abd504d7b278f3c927d2748ea6df7f431e268c6e1024445f5e4bd763.log
hostname is not currently populated. What I am doing wrong?
cc @average-finland-92144 @freezing-airport-6809
t
are you using the default plugin?
g
Copy code
logging:
    level: 5
    plugins:
      cloudwatch:
        enabled: true
        templateUri: |-
          <https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group=/aws/containerinsights/prod-next-datologyai-k8s/application;stream={{> .hostname }}.var.log.containers.{{ .podName }}_{{ .namespace }}_{{ .containerName }}-{{ .containerId }}.log
t
dumb question, but could you confirm the pod spec has a hostname
g
what's the best way to do that?
t
no that cant’ be it…
where did you get that pattern from? logging -> plugins -> cloudwatch
t
but where is the
templates
section?
for this eks started yaml that you guys provide
t
mmm i see
g
are you saying that it should be:
Copy code
templates:
  - displayName: <name-to-show>
    templateUris:
      - "blah"
t
could you try the new way?
that whole bit yeah
g
I think the weird thing is that it works
t
Copy code
task_logs:
  plugins:
    logs:
      templates:
        - displayName: <name-to-show>
          templateUris:
             .....
g
the template gets propagated
only the hostname is not correctly done
but I can give it a try
t
i’m hoping specifying it this way will trigger the correct logic.
haven’t had too much time to run this down, but thinking maybe the old way uses a different part of the code
g
hmm
I'm using helm btw -- is the above a helm thing or a kube config
t
it’s a flyte thing.
though i forget at which level it becomes a flyte thing
so
task_logs:
is the helm values part, referenced here for example
g
in my helm chart I have:
Copy code
configuration:
  logging:
    level: 5
    plugins:
      cloudwatch:
        enabled: true
t
if that’s rendering helm, then just change what’s below plugins then
g
Copy code
configuration.logging.level	int	1	
configuration.logging.plugins.cloudwatch.enabled	bool	false	
configuration.logging.plugins.cloudwatch.templateUri	string	""
in the flyte binary helm chart nothing else is exposed
t
yeah it’s okay
g
I'm using the flyte-binary helm chart btw
whatever you put under
flyte-binary.configuration.logging.plugins
will show up in the config map in the right place.
g
makes sense
t
it’s hard to tell where helm ends and where flyte begins…
i have to check every time
g
Copy code
configuration:
  logging:
    level: 5
    plugins:
      templates:
        - displayName: <name-to-show>
          templateUris:
            - "<https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group=/flyte-production/kubernetes;stream=var.log.containers.{{.podName}}_{{.namespace}}_{{.containerName}}-{{.containerId}}.log>"
so something like this?
t
yeah
wait no
you don’t need logs
that’s already in the helm chart.
delete logs and unindent
cuz the helm chart is
Copy code
logs: {{- include "flyte-binary.configuration.logging.plugins" . | nindent 8 }}
g
updated ^
t
yeah try it
and add in host ofc
g
yeah yeah
ok trying in a bit
hmm I don't think my pod spec has a hostname tho
I think it has a spec.nodeName
t
oh really.
but that’s not a flyte thing… that field comes from the k8s library