Is there any way with GKE to tag logs with the pre...
# prefect-kubernetes
j
Is there any way with GKE to tag logs with the prefect task id that the log belongs to? I can see flow run ID as part of the logging tabs, but can I get more granular?
c
you should be able to include the TaskRunContext which has task_run_id
j
How would we do that?
c
I’m not sure if GKE is doing anything special specifically for logging, but Prefect itself is logging based on the default logging configuration + whatever you have additionally configured. Additional configuration to raise / export the task run context and ID would be exported / logged based on these values here
it looks like what you posted above is a K8s job in prefect v1?
I don’t believe that task ID’s are part of the job, but would need to verify. That said, surfacing that can be done using the logger and just adding it manually e.g. https://discourse.prefect.io/t/how-can-i-add-logs-to-my-flow/86