Lorenzo Gentile
02/13/2026, 8:15 AMMarvin
02/13/2026, 8:15 AMMarvin
02/13/2026, 8:21 AMimport logging
logging.getLogger("httpx").setLevel(logging.WARNING)
- With a Prefect logging config (recommended for workers/flow pods). Create a logging YAML and point Prefect to it:
logging.yml
version: 1
disable_existing_loggers: false
loggers:
httpx:
level: WARNING
propagate: true
prefect:
level: ${PREFECT_LOGGING_LEVEL:-INFO}
prefect._internal:
level: ${PREFECT_INTERNAL_LOGGING_LEVEL:-ERROR}
root:
level: WARNING
handlers: [console]
Then set:
PREFECT_LOGGING_CONFIG_PATH=/path/to/logging.yml
(In Kubernetes, mount this via a ConfigMap and set the env var on your worker and/or flow-run containers.)
- Note: By default Prefect’s root logger is WARNING, which would already hide httpx INFO logs. If you’re seeing these, something in your image or logging config is likely raising the root level to INFO—this YAML brings it back under control while keeping Prefect logs at INFO.
3) If you’re using explicit task-level leases
- If you’re manually calling a concurrency/lease context with a very short lease_duration, renewals will be more frequent. Increase the lease duration in that call if appropriate to reduce the frequency of renewals.
A few clarifications that may help
- The renewal interval for deployment-level leases is currently fixed (renew at 75% of a 300s window). There isn’t a user-facing knob to change that interval for deployment leases.
- Seeing 204 No Content is good; it means the lease renewal is succeeding.
- If you’re observing renewal spam much more frequently than every few minutes, let me know — that can happen if something keeps failing and retrying or if a very short custom lease is in play.
If you tell me whether these logs are coming from your worker pods or the flow-run job pods, I can share a minimal, copy/paste YAML snippet to apply the logging config in your setup.