Skip to content

Commit

Permalink
Turn off telemetry for lambda
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Wang <[email protected]>
  • Loading branch information
felixwang9817 committed Oct 1, 2021
1 parent 338dc8c commit 9d6f45b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions sdk/python/feast/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@

# feature_store.yaml environment variable name for remote feature server
SERVER_CONFIG_BASE64_ENV_NAME: str = "FEAST_CONFIG_BASE64"

# Environment variable for toggling usage
FEAST_USAGE = "FEAST_USAGE"
10 changes: 6 additions & 4 deletions sdk/python/feast/infra/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
from colorama import Fore, Style

import feast
from feast import FeatureTable, __version__
from feast import Entity, FeatureTable, FeatureView, __version__
from feast.constants import (
AWS_LAMBDA_FEATURE_SERVER_IMAGE,
FEAST_USAGE,
SERVER_CONFIG_BASE64_ENV_NAME,
)
from feast.entity import Entity
from feast.errors import S3RegistryBucketForbiddenAccess, S3RegistryBucketNotExist
from feast.feature_view import FeatureView
from feast.infra.passthrough_provider import PassthroughProvider
from feast.infra.utils import aws_utils
from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto
Expand Down Expand Up @@ -78,7 +77,10 @@ def update_infra(
PackageType="Image",
MemorySize=1769,
Environment={
"Variables": {SERVER_CONFIG_BASE64_ENV_NAME: config_base64}
"Variables": {
SERVER_CONFIG_BASE64_ENV_NAME: config_base64,
FEAST_USAGE: "False",
}
},
)
function = aws_utils.get_lambda_function(lambda_client, resource_name)
Expand Down
3 changes: 2 additions & 1 deletion sdk/python/feast/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import requests

from feast.constants import FEAST_USAGE
from feast.version import get_version

USAGE_ENDPOINT = "https://usage.feast.dev"
Expand Down Expand Up @@ -60,7 +61,7 @@ def __init__(self):

def check_env_and_configure(self):
usage_enabled = (
os.getenv("FEAST_USAGE", default="True") == "True"
os.getenv(FEAST_USAGE, default="True") == "True"
) # written this way to turn the env var string into a boolean

# Check if it changed
Expand Down

0 comments on commit 9d6f45b

Please sign in to comment.