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

Capture traces for updateParseTreeOnEdit #4101

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

Conversation

philipp-spiess
Copy link
Member

Capture traces for updateParseTreeOnEdit

Test plan

  • Trivial, CI will check

@philipp-spiess
Copy link
Member Author

@valerybugakov Saw that there's also observableParse. Should we use this instead? Not sure why we would need two places but I assume this place can be very high frequency (since it's on every document change)

const updatedTree = parser.safeParse(document.getText(), tree)
parseTreesPerFile.set(cacheKey, updatedTree)
wrapInActiveSpan('updateParseTreeOnEdit', span => {
span.setAttribute('sampled', true)
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to sample all these spans? The volume will be huge.

Copy link
Member Author

Choose a reason for hiding this comment

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

No I think that would probably be too large, I agree.

})
}

const updatedTree = parser.safeParse(document.getText(), tree)
Copy link
Member

Choose a reason for hiding this comment

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

If we decide to sample all spans here, we can move span.setAttribute('sampled', true) and span.setAttribute('languageId', languageId) into the observableParse and use it here.

@valerybugakov
Copy link
Member

Not sure why we would need two places, but I assume this place can be very high frequency

@philipp-spiess, that's right. I didn't instrument this part because it happens on every keystroke change.

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.

None yet

3 participants