Skip to content

Snowflake Apps telemetry spans#2873

Merged
sfc-gh-gbloom merged 11 commits intomainfrom
gbloom/snowflake-apps-telemetry
Apr 15, 2026
Merged

Snowflake Apps telemetry spans#2873
sfc-gh-gbloom merged 11 commits intomainfrom
gbloom/snowflake-apps-telemetry

Conversation

@sfc-gh-gbloom
Copy link
Copy Markdown
Contributor

@sfc-gh-gbloom sfc-gh-gbloom commented Apr 10, 2026

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.
  • I've described my changes in the documentation.

Changes description

Wrap key operations in CLIMetrics.span() context managers so phase duration and errors are captured in CLI telemetry payloads.

setup command:

  • snowflake_app.setup.resolve_defaults — fetching account parameters, role, and config table defaults

deploy command (both artifact-repo and image-repo paths):

  • snowflake_app.bundle — artifact bundling
  • snowflake_app.upload — stage upload
  • snowflake_app.build — build job submission and polling
  • snowflake_app.deploy_service — service creation/upgrade
  • snowflake_app.endpoint_provision — endpoint URL polling

@sfc-gh-gbloom sfc-gh-gbloom marked this pull request as ready for review April 10, 2026 20:39
@sfc-gh-gbloom sfc-gh-gbloom requested a review from a team as a code owner April 10, 2026 20:39
sfc-gh-jfloyd and others added 7 commits April 13, 2026 07:35
Wrap the five deployment phases (bundle, upload, build, deploy_service,
endpoint_provision) with CLIMetrics.span() context managers so each
phase duration and errors are captured in CLI telemetry payloads.

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
When a build job or deployed service enters FAILED state, fetch the
last 50 lines of container logs via SYSTEM$GET_SERVICE_LOGS and print
them before re-raising the error. This gives immediate visibility into
why a build or deploy failed without requiring a manual log query.

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
The cherry-picked telemetry commit only covered the non-artifact-repo
code paths. Wrap the artifact-repo build (build_app_artifact_repo +
polling) and deploy (run_app_artifact_repo) in matching
snowflake_app.build and snowflake_app.deploy_service spans.

Made-with: Cursor
The cherry-pick conflict resolution renamed get_service_logs to
get_container_logs (SYSTEM$GET_SERVICE_LOGS) to avoid colliding with
the existing get_service_logs (SYSTEM$GET_APPLICATION_SERVICE_LOGS).
Update the manager unit tests and _fetch_and_print_failure_logs mock
tests to use the renamed method.

Made-with: Cursor
Test that both the image-repo and artifact-repo deploy paths record
exactly the expected spans in order (bundle, upload, build,
deploy_service, endpoint_provision). Also verify that a build failure
records the error class in the span. Uses a shared _make_deploy_mocks
helper to reduce duplication with existing deploy tests.

Made-with: Cursor
@sfc-gh-gbloom sfc-gh-gbloom requested a review from a team as a code owner April 14, 2026 12:42
@sfc-gh-gbloom sfc-gh-gbloom enabled auto-merge (squash) April 15, 2026 14:12
@sfc-gh-gbloom sfc-gh-gbloom merged commit fa7027b into main Apr 15, 2026
26 of 27 checks passed
@sfc-gh-gbloom sfc-gh-gbloom deleted the gbloom/snowflake-apps-telemetry branch April 15, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants