-
Notifications
You must be signed in to change notification settings - Fork 994
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
Add telemetry to Python SDK #1289
Conversation
/kind feature |
sdk/python/feast/client.py
Outdated
@@ -959,6 +997,15 @@ def get_online_features( | |||
{'sales:daily_transactions': [1.1,1.2], 'sales:customer_id': [0,1]} | |||
""" | |||
|
|||
if self._telemetry_enabled: | |||
if self._telemetry_counter["get_online_features"] % 100 == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can bump this to % 1000
.
docs/advanced/telemetry.md
Outdated
|
||
### How to disable telemetry | ||
|
||
To opt out of telemetry, simply set the environment variable `FEAST_TELEMETRY` to `False` in the environment in which the Feast client is run. You can check telemetry is disabled by ensuring there is no file named `~/.feast/telemetry`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are providing two approaches to users? Which one should they use (deletion or env var)?
sdk/python/feast/client.py
Outdated
else: | ||
self._telemetry_id = str(uuid.uuid4()) | ||
print( | ||
"Feast is an open-source project that collects anonymized usage statistics. To opt out or learn more see https://docs.feast.dev/v/master/advanced/telemetry" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I've been told not to use open-source
and instead use open source
https://developers.google.com/style/word-list#letter-o
|
||
sleep(30) | ||
bq_client = bigquery.Client() | ||
query = f"select * from `kf-feast.feast_telemetry.cloudfunctions_googleapis_com_cloud_functions_*` where JSON_EXTRACT(textPayload, '$.is_test')='\"True\"' and JSON_EXTRACT(textPayload, '$.timestamp')>'\"{timestamp.isoformat()}\"'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a time range filter here please? This query can become very expensive if we have a lot of data. We should also ensure that there is day partitioning on the BQ table I think.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jklegar, woop The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
Signed-off-by: Jacob Klegar <jacob@tecton.ai>
Signed-off-by: Jacob Klegar <jacob@tecton.ai>
Signed-off-by: Jacob Klegar <jacob@tecton.ai>
Signed-off-by: Jacob Klegar <jacob@tecton.ai>
Signed-off-by: Jacob Klegar <jacob@tecton.ai>
Signed-off-by: Jacob Klegar <jacob@tecton.ai>
New changes are detected. LGTM label has been removed. |
@jklegar: Updated the
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
* add basic anonymous telemetry Signed-off-by: Jacob Klegar <jacob@tecton.ai> * add telemetry docs Signed-off-by: Jacob Klegar <jacob@tecton.ai> * add testing Signed-off-by: Jacob Klegar <jacob@tecton.ai> * fix test Signed-off-by: Jacob Klegar <jacob@tecton.ai> * lint Signed-off-by: Jacob Klegar <jacob@tecton.ai> * fix prow job Signed-off-by: Jacob Klegar <jacob@tecton.ai> * bugfix Signed-off-by: Jacob Klegar <jacob@tecton.ai> * fix env var setting Signed-off-by: Jacob Klegar <jacob@tecton.ai> * lint Signed-off-by: Jacob Klegar <jacob@tecton.ai> * address comments and fix unit test Signed-off-by: Jacob Klegar <jacob@tecton.ai> * lint Signed-off-by: Jacob Klegar <jacob@tecton.ai>
What this PR does / why we need it: adds basic telemetry
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: