Commits
Click on a commit to change the comparison rangeAdd logfire sampling config, fix boolean env var handling, and exclude /admin/settings from OpenAPI schema
**Logfire sampling configuration:**
introduces configurable logfire sampling via environment variables to reduce
span budget consumption for deployments with high traffic.
environment variables (all optional with sane defaults):
- PREFECT_LOGFIRE_SAMPLING_HEAD_RATE: 0.1 (10% of traces)
- PREFECT_LOGFIRE_SAMPLING_LEVEL_THRESHOLD: "warn"
- PREFECT_LOGFIRE_SAMPLING_DURATION_THRESHOLD: 5.0 seconds
- PREFECT_LOGFIRE_SAMPLING_BACKGROUND_RATE: 0.01 (1% tail sampling)
centralizes logfire configuration in prefect._internal.observability module
to avoid duplication and ensure consistent behavior.
fixes #19360 where PREFECT_LOGFIRE_ENABLED=0 doesn't properly disable logfire.
the fix uses Pydantic's TypeAdapter for proper boolean parsing that handles
"0", "false", "False", etc.
supersedes #19362
**OpenAPI schema fix:**
excludes /admin/settings endpoint from OpenAPI schema to prevent Settings type
pollution. the endpoint returns the full prefect.settings.Settings object,
which was causing FastAPI to include the entire Settings model tree
(APISettings, CLISettings, etc.) in the generated schema.
this was causing the pre-commit hook to regenerate ui-v2/src/api/prefect.ts
with 2000+ lines of spurious Settings type definitions every time someone
modified a file matching src/prefect/server/api/.*, polluting PRs with
unrelated changes.
the UI doesn't need these types since it just displays settings as raw JSON.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>12 hours ago
by zzstoatzz