current behavior
in src/prefect/server/database/configurations.py:38, we check:
if os.getenv(PREFECT_LOGFIRE_ENABLED):
import logfire
this is truthy for ANY string value, including "0" or "false". so setting PREFECT_LOGFIRE_ENABLED=0 still tries to import logfire.
expected behavior
should check explicitly for truthy values:
if os.getenv(PREFECT_LOGFIRE_ENABLED) == "1":
import logfire
or use proper boolean parsing like pydantic settings does.
impact
this makes it impossible to disable logfire via environment variable override in deployment scenarios where env vars are inherited (e.g., kubernetes helm charts).
discovered while trying to disable logfire for database migrations that inherit PREFECT_LOGFIRE_ENABLED=1 from server config but don't have logfire installed.