Leon Kozlowski

    Leon Kozlowski

    10 months ago
    Hi all - I am wondering what the best way is to determine what agent a flow is running on while its in progress
    Anna Geller

    Anna Geller

    10 months ago
    the easiest way would be to do find that out through labels, e.g. if you have the label “dev” assigned to a specific agent, and the same label is assigned to a flow’s run configuration
    Leon Kozlowski

    Leon Kozlowski

    10 months ago
    would that be say a subclassed Task’s context?
    Anna Geller

    Anna Geller

    10 months ago
    it’s an attribute of a run configuration. You can see it in the UI under flow. From code, you could inspect it this way:
    from prefect.run_configs import LocalRun
    run_config=LocalRun(labels=["dev"])
    
    # inspecting:
    run_config.labels
    {'dev'}
    Kevin Kho

    Kevin Kho

    10 months ago
    You can go to the
    Agents
    tab in the dashboard and it will give you the view
    Leon Kozlowski

    Leon Kozlowski

    10 months ago
    I had terrible wording in my question, I mean in the context of inside a task
    Kevin Kho

    Kevin Kho

    10 months ago
    It might have to be a graphql query. It won’t be in context
    This is how the UI does it
    Leon Kozlowski

    Leon Kozlowski

    10 months ago
    Got it - thank you
    Kevin Kho

    Kevin Kho

    10 months ago
    Actually this might not help because you need to know the agent ids head of time to check
    Leon Kozlowski

    Leon Kozlowski

    10 months ago
    I think I can solve the issue I’m facing with configmap values for my agent - its basically agent specific configuration values
    Kevin Kho

    Kevin Kho

    10 months ago
    That sounds good