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

SNOW-1637215: Add describe query telemetry #2622

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sfc-gh-jdu
Copy link
Collaborator

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1637215

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
  3. Please describe how your code solves the related issue.

Add telemetry for describe query mentioned in https://docs.google.com/document/d/1DAN1I99BQd1CBBu_pLvWb9vLReTC7HIbfppxeVbXCSg/edit?tab=t.0#heading=h.r285g4qcslsz

@sfc-gh-jdu sfc-gh-jdu added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Nov 13, 2024
@sfc-gh-jdu sfc-gh-jdu requested review from a team as code owners November 13, 2024 23:02
Comment on lines +95 to +99
stack = traceback.extract_stack(limit=10)[:-1]
if len(stack) >= 2:
stack_trace = [frame.line for frame in stack]
else:
stack_trace = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we doing this to figure out which is the biggest contributor of describe queries?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

TYPE_DESCRIBE_QUERY_DETAILS = "snowpark_describe_query_details"
SQL_TEXT = "sql_text"
E2E_TIME = "e2e_time"
STACK_TRACE = "stack_trace"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good that we're capturing the stack trace. But I imagine we'll need to further process it to extract the specific operations resulting in describe queries?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, we can do the parsing on the dashboard side

Copy link
Contributor

@sfc-gh-helmeleegy sfc-gh-helmeleegy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just had one question.

@sfc-gh-jdu sfc-gh-jdu force-pushed the jdu-SNOW-1637215-describe-telemetry branch from 0ee4bda to 56c7f03 Compare November 15, 2024 23:40
stack = traceback.extract_stack(limit=10)[:-1]
if len(stack) >= 2:
stack_trace = [frame.line for frame in stack]
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why when len(stack) < 2: the stack_trace is None?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants