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

Add telemetry to Python SDK #1289

Merged
merged 11 commits into from
Jan 28, 2021
Merged

Add telemetry to Python SDK #1289

merged 11 commits into from
Jan 28, 2021

Conversation

jklegar
Copy link
Collaborator

@jklegar jklegar commented Jan 26, 2021

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?:

Starting in v0.9, Feast will begin to collect anonymized usage statistics. To opt out or learn more see https://docs.feast.dev/v/master/advanced/telemetry

@jklegar
Copy link
Collaborator Author

jklegar commented Jan 26, 2021

/kind feature

@feast-ci-bot feast-ci-bot added kind/feature New feature or request and removed needs-kind labels Jan 26, 2021
@jklegar jklegar changed the title Jacob usage telemetry Jan 26, 2021
@jklegar jklegar changed the title telemetry Add telemetry to Python SDK Jan 26, 2021
@@ -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:
Copy link
Member

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.


### 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`.
Copy link
Member

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)?

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"
Copy link
Member

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()}\"'"
Copy link
Member

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.

@feast-ci-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@woop
Copy link
Member

woop commented Jan 28, 2021

/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>
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>
@feast-ci-bot
Copy link
Collaborator

New changes are detected. LGTM label has been removed.

@feast-ci-bot feast-ci-bot removed the lgtm label Jan 28, 2021
@jklegar jklegar merged commit 82dab78 into feast-dev:master Jan 28, 2021
@feast-ci-bot
Copy link
Collaborator

@jklegar: Updated the config configmap in namespace prow at cluster default using the following files:

  • key config.yaml using file .prow/config.yaml

In response to this:

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?:

Starting in v0.9, Feast will begin to collect anonymized usage statistics. To opt out or learn more see https://docs.feast.dev/v/master/advanced/telemetry

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.

jklegar added a commit that referenced this pull request Jan 29, 2021
* 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>
@jklegar jklegar deleted the jacob_usage branch February 4, 2021 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants