I’m trying to add the root logger to vertex agent runs, but I can’t get it to work properly.
I am passing through:
run_config = VertexRun(
image="my-image",
env={"PREFECT__LOGGING__EXTRA_LOGGERS": "['']"},
)
I can see the environment variable submitted on the vertex job. The full submitted vertex job config (redacted potentially sensitive info) is here:
{
"workerPoolSpecs": [
{
"machineSpec": {
"machineType": "e2-standard-4"
},
"replicaCount": "1",
"diskSpec": {
"bootDiskType": "pd-ssd",
"bootDiskSizeGb": 100
},
"containerSpec": {
"imageUri": "my-image",
"command": [
"prefect",
"execute",
"flow-run"
],
"env": [
{
"name": "PREFECT__LOGGING__LEVEL",
"value": "INFO"
},
{
"name": "PREFECT__LOGGING__EXTRA_LOGGERS",
"value": "['']"
},
{
"name": "PREFECT__BACKEND",
"value": "cloud"
},
{
"name": "PREFECT__CLOUD__API",
"value": "https://api.prefect.io"
},
{
"name": "PREFECT__CLOUD__API_KEY",
"value": "REDACTED"
},
{
"name": "PREFECT__CLOUD__TENANT_ID",
"value": "REDACTED"
},
{
"name": "PREFECT__CLOUD__AGENT__LABELS",
"value": "['vertex']"
},
{
"name": "PREFECT__CLOUD__SEND_FLOW_RUN_LOGS",
"value": "true"
},
{
"name": "PREFECT__CONTEXT__FLOW_RUN_ID",
"value": "REDACTED"
},
{
"name": "PREFECT__CONTEXT__FLOW_ID",
"value": "REDACTED"
},
{
"name": "PREFECT__CLOUD__USE_LOCAL_SECRETS",
"value": "false"
},
{
"name": "PREFECT__ENGINE__FLOW_RUNNER__DEFAULT_CLASS",
"value": "prefect.engine.cloud.CloudFlowRunner"
},
{
"name": "PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS",
"value": "prefect.engine.cloud.CloudTaskRunner"
},
{
"name": "PREFECT__LOGGING__LOG_TO_CLOUD",
"value": "true"
},
{
"name": "PREFECT__CLOUD__AUTH_TOKEN",
"value": "REDACTED"
}
]
}
}
],
"serviceAccount": REDACTED
}
When I use the same env variable with local run, the logs show up correctly in prefect cloud. For example, this works correctly:
run_config = LocalRun(env={"PREFECT__LOGGING__EXTRA_LOGGERS": "['']"})
It just seems like there is something wrong with the vertex ai logging. Is there a bug? Or is there some configuration/settings that I have wrong?
Any help would be much appreciated. Thanks!