forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_config.py
More file actions
106 lines (80 loc) · 4.03 KB
/
base_config.py
File metadata and controls
106 lines (80 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 2025 The Feast Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional
from pydantic import StrictBool, StrictInt
from feast.repo_config import FeastConfigBaseModel
class FeatureLoggingConfig(FeastConfigBaseModel):
enabled: StrictBool = False
"""Whether the feature server should log served features."""
flush_interval_secs: StrictInt = 600
"""Interval of flushing logs to the destination in offline store."""
write_to_disk_interval_secs: StrictInt = 30
"""Interval of dumping logs collected in memory to local disk."""
queue_capacity: StrictInt = 100000
"""Log queue capacity. If number of produced logs is bigger than
processing speed logs will be accumulated in the queue.
After queue length will reach this number all new items will be rejected."""
emit_timeout_micro_secs: StrictInt = 10000
"""Timeout for adding new log item to the queue."""
class MetricsConfig(FeastConfigBaseModel):
"""Prometheus metrics configuration.
Follows the same pattern as ``FeatureLoggingConfig``: a single
``enabled`` flag controls global on/off, and per-category booleans
allow fine-grained suppression. Can also be enabled at runtime via
the ``feast serve --metrics`` CLI flag — either option is sufficient.
"""
enabled: StrictBool = False
"""Whether Prometheus metrics collection and the metrics HTTP server
(default port 8000) should be enabled."""
resource: StrictBool = True
"""Emit CPU and memory usage gauges (feast_feature_server_cpu_usage,
feast_feature_server_memory_usage)."""
request: StrictBool = True
"""Emit per-endpoint request counters and latency histograms
(feast_feature_server_request_total,
feast_feature_server_request_latency_seconds)."""
online_features: StrictBool = True
"""Emit online feature retrieval metrics
(feast_online_features_request_total,
feast_online_features_entity_count,
feast_feature_server_online_store_read_duration_seconds,
feast_feature_server_transformation_duration_seconds,
feast_feature_server_write_transformation_duration_seconds).
ODFV transformation metrics additionally require track_metrics=True
on the OnDemandFeatureView definition."""
push: StrictBool = True
"""Emit push/write request counters
(feast_push_request_total)."""
materialization: StrictBool = True
"""Emit materialization success/failure counters and duration histograms
(feast_materialization_result_total,
feast_materialization_duration_seconds)."""
freshness: StrictBool = True
"""Emit per-feature-view freshness gauges
(feast_feature_freshness_seconds)."""
class BaseFeatureServerConfig(FeastConfigBaseModel):
"""Base Feature Server config that should be extended"""
enabled: StrictBool = False
"""Whether the feature server should be launched."""
metrics: Optional[MetricsConfig] = None
"""Prometheus metrics configuration. Set ``metrics.enabled: true`` or
pass the ``feast serve --metrics`` CLI flag to activate."""
feature_logging: Optional[FeatureLoggingConfig] = None
""" Feature logging configuration """
offline_push_batching_enabled: Optional[StrictBool] = None
"""Whether to batch writes to the offline store via the `/push` endpoint."""
offline_push_batching_batch_size: Optional[StrictInt] = None
"""The maximum batch size for offline writes via `/push`."""
offline_push_batching_batch_interval_seconds: Optional[StrictInt] = None
"""The batch interval between offline writes via `/push`."""