Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename telemetry to usage #1800

Merged
merged 1 commit into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk/python/feast/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from feast.version import get_version

USAGE_ENDPOINT = "https://us-central1-kf-feast.cloudfunctions.net/bq_telemetry_logger"
USAGE_ENDPOINT = "https://usage.feast.dev"
_logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -83,7 +83,7 @@ def log(self, function_name: str):
self._usage_counter["get_online_features"] = 2 # avoid overflow
json = {
"function_name": function_name,
"telemetry_id": self.usage_id,
"usage_id": self.usage_id,
"timestamp": datetime.utcnow().isoformat(),
"version": get_version(),
"os": sys.platform,
Expand All @@ -104,7 +104,7 @@ def log_exception(self, error_type: str, traceback: List[Tuple[str, int, str]]):
json = {
"error_type": error_type,
"traceback": traceback,
"telemetry_id": self.usage_id,
"usage_id": self.usage_id,
"version": get_version(),
"os": sys.platform,
"is_test": self._is_test,
Expand Down
6 changes: 3 additions & 3 deletions sdk/python/usage_tests/test_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ def read_bigquery_usage_id(usage_id):
bq_client = bigquery.Client()
query = f"""
SELECT
telemetry_id
usage_id
FROM (
SELECT
JSON_EXTRACT(textPayload, '$.telemetry_id') AS telemetry_id
JSON_EXTRACT(textPayload, '$.usage_id') AS usage_id
FROM
`{USAGE_BIGQUERY_TABLE}`
WHERE
timestamp >= TIMESTAMP(\"{datetime.utcnow().date().isoformat()}\"))
WHERE
telemetry_id = '\"{usage_id}\"'
usage_id = '\"{usage_id}\"'
"""
query_job = bq_client.query(query)
return query_job.result()