Skip to content

Commit 82dab78

Browse files
authored
Add telemetry to Python SDK (feast-dev#1289)
* 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>
1 parent 05a5949 commit 82dab78

15 files changed

Lines changed: 232 additions & 5 deletions

.prow/config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,26 @@ presubmits:
144144
- image: python:3.7
145145
command: ["infra/scripts/test-python-sdk.sh"]
146146

147+
- name: test-telemetry
148+
decorate: true
149+
run_if_changed: "sdk/python/.*"
150+
spec:
151+
containers:
152+
- image: python:3.7
153+
command: ["infra/scripts/test-telemetry.sh"]
154+
env:
155+
- name: GOOGLE_APPLICATION_CREDENTIALS
156+
value: /etc/gcloud/service-account.json
157+
volumeMounts:
158+
- mountPath: /etc/gcloud/service-account.json
159+
name: service-account
160+
readOnly: true
161+
subPath: service-account.json
162+
volumes:
163+
- name: service-account
164+
secret:
165+
secretName: feast-service-account
166+
147167
- name: test-golang-sdk
148168
decorate: true
149169
spec:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ install-python: compile-protos-python
7474
python -m pip install -e sdk/python
7575

7676
test-python:
77-
pytest --verbose --color=yes sdk/python/tests
77+
FEAST_TELEMETRY=False pytest --verbose --color=yes sdk/python/tests
7878

7979
format-python:
8080
# Sort

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* [Security](advanced/security.md)
4444
* [Audit Logging](advanced/audit-logging.md)
4545
* [Metrics](advanced/metrics.md)
46+
* [Telemetry](advanced/telemetry.md)
4647
* [Troubleshooting](advanced/troubleshooting.md)
4748

4849
## Reference

docs/advanced/telemetry.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Telemetry
2+
3+
### How telemetry is used
4+
5+
The Feast maintainers use anonymous usage statistics to help shape the Feast roadmap. Several client methods are tracked, beginning in Feast 0.9. Users are assigned a UUID which is sent along with the name of the method, the Feast version, the OS (using `sys.platform`), and the current time. For more detailed information see [the source code](https://github.com/feast-dev/feast/blob/master/sdk/python/feast/telemetry.py).
6+
7+
### How to disable telemetry
8+
9+
To opt out of telemetry, simply set the environment variable `FEAST_TELEMETRY` to `False` in the environment in which the Feast client is run.
10+

infra/scripts/test-end-to-end-aws.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pip install "s3fs" "boto3" "urllib3>=1.25.4"
66

77
export DISABLE_FEAST_SERVICE_FIXTURES=1
88
export DISABLE_SERVICE_FIXTURES=1
9+
export FEAST_TELEMETRY="False"
910

1011
PYTHONPATH=sdk/python pytest tests/e2e/ \
1112
--feast-version develop \
@@ -17,4 +18,4 @@ PYTHONPATH=sdk/python pytest tests/e2e/ \
1718
--redis-url $NODE_IP:32379 \
1819
--emr-region us-west-2 \
1920
--kafka-brokers $NODE_IP:30092 \
20-
-m "not bq"
21+
-m "not bq"

infra/scripts/test-end-to-end-gcp.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ make build-java-no-tests REVISION=develop
1212
python -m pip install --upgrade pip setuptools wheel
1313
make install-python
1414
python -m pip install -qr tests/requirements.txt
15+
export FEAST_TELEMETRY="False"
1516

1617
su -p postgres -c "PATH=$PATH HOME=/tmp pytest -v tests/e2e/ \
1718
--feast-version develop --env=gcloud --dataproc-cluster-name feast-e2e \

infra/scripts/test-end-to-end-sparkop.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pip install "s3fs" "boto3" "urllib3>=1.25.4"
66

77
export DISABLE_FEAST_SERVICE_FIXTURES=1
88
export DISABLE_SERVICE_FIXTURES=1
9+
export FEAST_TELEMETRY="False"
910

1011
export FEAST_SPARK_K8S_NAMESPACE=sparkop
1112

@@ -17,4 +18,4 @@ PYTHONPATH=sdk/python pytest tests/e2e/ \
1718
--staging-path $STAGING_PATH \
1819
--redis-url sparkop-redis-master.sparkop.svc.cluster.local:6379 \
1920
--kafka-brokers sparkop-kafka.sparkop.svc.cluster.local:9092 \
20-
-m "not bq"
21+
-m "not bq"

infra/scripts/test-end-to-end.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ make build-java-no-tests REVISION=develop
1010
python -m pip install --upgrade pip setuptools wheel
1111
make install-python
1212
python -m pip install -qr tests/requirements.txt
13+
export FEAST_TELEMETRY="False"
1314

14-
su -p postgres -c "PATH=$PATH HOME=/tmp pytest -v tests/e2e/ --feast-version develop"
15+
su -p postgres -c "PATH=$PATH HOME=/tmp pytest -v tests/e2e/ --feast-version develop"

infra/scripts/test-integration.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ python -m pip install --upgrade pip setuptools wheel
44
make install-python
55
python -m pip install -qr tests/requirements.txt
66

7-
pytest tests/integration --dataproc-cluster-name feast-e2e --dataproc-project kf-feast --dataproc-region us-central1 --dataproc-staging-location gs://feast-templocation-kf-feast
7+
export FEAST_TELEMETRY="False"
8+
pytest tests/integration --dataproc-cluster-name feast-e2e --dataproc-project kf-feast --dataproc-region us-central1 --dataproc-staging-location gs://feast-templocation-kf-feast

infra/scripts/test-python-sdk.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ make lint-python
1111

1212
cd sdk/python/
1313
pip install -e .
14+
cd tests/
15+
export FEAST_TELEMETRY="False"
1416
pytest --junitxml=${LOGS_ARTIFACT_PATH}/python-sdk-test-report.xml

0 commit comments

Comments
 (0)