Pieter Custers
08/22/2023, 8:59 AMstep_key
, how can I retrieve the run_id
? I prefer a sql-query that I can execute on the postgres db.
The context is that I’m doing an analysis on how much resources the job pods use in k8s. My starting point is the pod name, which gives me the run_id or step_key. I need to programatically retrieve the job and repo name with this information. It’s a one-time thing, so that’s why query-ing the postgres db directly seems the best/easiest way. Note that I cannot check/enter the pods because they might not live anymore.alex
08/22/2023, 2:42 PMevent
column of the event_logs
table for the events seen in the event stream by the k8s launcher / executor that include the metadata for what the job name was.Pieter Custers
08/22/2023, 2:56 PMalex
08/22/2023, 2:59 PMstep_key
? In the dagster code base this maps directly to op/asset name
with only pod name, the event log entries are the only piece of data that has persisted the mappingPieter Custers
08/22/2023, 3:03 PMdagster-step-026fbeb46ca9a1014d7db5832b239aa4-9v5d4
the pod name, what I called the “step_key” is 026fbeb46ca9a1014d7db5832b239aa4
Pieter Custers
08/22/2023, 3:03 PMPieter Custers
08/22/2023, 3:31 PMrun_id
is part of the pod name)alex
08/22/2023, 3:56 PMrun_id
and step_key
so can’t directly be used to calculate job / op name.
There are other labels / attributes of the job and pod k8s entities that can be used to discern the job and op name, but if you truly only have pod name then the previously mentioned event log look up is the only place that has the information persisted by dagster.Pieter Custers
08/23/2023, 4:14 AM