Skip to content

Commit

Permalink
chore: Adding logging to the feature server when the registry is refr…
Browse files Browse the repository at this point in the history
…eshed (feast-dev#3623)

Adding logging to the feature server when the registry is refreshed

Signed-off-by: Danny Chiao <[email protected]>
  • Loading branch information
adchia authored May 16, 2023
1 parent 9e7a8f0 commit bfb26c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/python/feast/infra/registry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ def _get_registry_proto(
assert isinstance(self.cached_registry_proto, RegistryProto)
return self.cached_registry_proto

logger.info("Registry cache expired, so refreshing")
registry_proto = self._registry_store.get_registry_proto()
self.cached_registry_proto = registry_proto
self.cached_registry_proto_created = datetime.utcnow()
Expand Down
4 changes: 4 additions & 0 deletions sdk/python/feast/infra/registry/snowflake.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
import uuid
from binascii import hexlify
Expand Down Expand Up @@ -59,6 +60,8 @@
from feast.saved_dataset import SavedDataset, ValidationReference
from feast.stream_feature_view import StreamFeatureView

logger = logging.getLogger(__name__)


class FeastMetadataKeys(Enum):
LAST_UPDATED_TIMESTAMP = "last_updated_timestamp"
Expand Down Expand Up @@ -174,6 +177,7 @@ def _refresh_cached_registry_if_necessary(self):
)

if expired:
logger.info("Registry cache expired, so refreshing")
self.refresh()

def teardown(self):
Expand Down
4 changes: 4 additions & 0 deletions sdk/python/feast/infra/registry/sql.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import uuid
from datetime import datetime, timedelta
from enum import Enum
Expand Down Expand Up @@ -178,6 +179,8 @@ class FeastMetadataKeys(Enum):
Column("last_updated_timestamp", BigInteger, nullable=False),
)

logger = logging.getLogger(__name__)


class SqlRegistryConfig(RegistryConfig):
registry_type: StrictStr = "sql"
Expand Down Expand Up @@ -256,6 +259,7 @@ def _refresh_cached_registry_if_necessary(self):
)

if expired:
logger.info("Registry cache expired, so refreshing")
self.refresh()

def get_stream_feature_view(
Expand Down

0 comments on commit bfb26c3

Please sign in to comment.