snowflake-telemetry-python is a package that supports emitting telemetry data from Python UDFs, UDTFs, and Stored Procedures.
To install the latest release of this package as an end user, run
VERSION="0.3.0"
curl -L "https://github.com/snowflakedb/snowflake-telemetry-python/archive/refs/tags/v${VERSION}.tar.gz" > "snowflake-telemetry-python-${VERSION}.tar.gz"
tar -xvf "snowflake-telemetry-python-${VERSION}.tar.gz"
cd "snowflake-telemetry-python-${VERSION}"
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install .To develop this package, run
git clone git@github.com:snowflakedb/snowflake-telemetry-python.git
cd snowflake-telemetry-python
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install . ./tests/snowflake-telemetry-test-utilsTo regenerate the code under src/snowflake/_internal/opentelemetry/proto/, execute the script ./scripts/proto_codegen.sh. The script expects the src/snowflake/_internal/opentelemetry/proto/ directory to exist, and will delete all .py files in it before regerating the code.
The opentelemetry-proto source used for code generation is pinned to the immutable commit in PROTO_REPO_COMMIT. The current commit corresponds to the v1.7.0 release used by opentelemetry-python. When updating the proto version, update the full commit hash rather than using a movable branch or tag.
Release to pypi is done via Upload Python Package workflow and it is triggered whenever a new release is created. Before creating a release, the PR to update versions (example) should be merged to main branch first.