Bases: PrefectBaseSettings
Settings for controlling API client behavior
Source code in src/prefect/settings/models/client.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 | class ClientSettings(PrefectBaseSettings):
"""
Settings for controlling API client behavior
"""
model_config = _build_settings_config(("client",))
max_retries: int = Field(
default=5,
ge=0,
description="""
The maximum number of retries to perform on failed HTTP requests.
Defaults to 5. Set to 0 to disable retries.
See `PREFECT_CLIENT_RETRY_EXTRA_CODES` for details on which HTTP status codes are
retried.
""",
)
retry_jitter_factor: float = Field(
default=0.2,
ge=0.0,
description="""
A value greater than or equal to zero to control the amount of jitter added to retried
client requests. Higher values introduce larger amounts of jitter.
Set to 0 to disable jitter. See `clamped_poisson_interval` for details on the how jitter
can affect retry lengths.
""",
)
retry_extra_codes: ClientRetryExtraCodes = Field(
default_factory=set,
description="""
A list of extra HTTP status codes to retry on. Defaults to an empty list.
429, 502 and 503 are always retried. Please note that not all routes are idempotent and retrying
may result in unexpected behavior.
""",
examples=["404,429,503", "429", {404, 429, 503}],
)
csrf_support_enabled: bool = Field(
default=True,
description="""
Determines if CSRF token handling is active in the Prefect client for API
requests.
When enabled (`True`), the client automatically manages CSRF tokens by
retrieving, storing, and including them in applicable state-changing requests
""",
)
metrics: ClientMetricsSettings = Field(
default_factory=ClientMetricsSettings,
description="Settings for controlling metrics reporting from the client",
)
|