https://prefect.io logo
l

Luke Dolan

07/18/2023, 12:16 PM
Hey, I'm trying to access details of the flow run for a Process infrastructure what host it's running on. I see in the infrastrucutre_pid of the FlowRun there is some details on the host and process id but is there a more concrete field that defines these details?
c

Christopher Boyd

07/18/2023, 3:33 PM
You can do it in code, but not from the prefect process side directly no
Copy code
@task
def log_platform_info():
    import platform
    import sys
    logger = get_run_logger()
    <http://logger.info|logger.info>("Host's network name = %s", platform.node())
    <http://logger.info|logger.info>("Python version = %s", platform.python_version())
    <http://logger.info|logger.info>("Platform information (instance type) = %s ", platform.platform())
    <http://logger.info|logger.info>("OS/Arch = %s/%s", sys.platform, platform.machine())
l

Luke Dolan

07/18/2023, 6:43 PM
And not from the PrefectClient then either?