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

[red-knot] Add tracing to Salsa queries #11949

Merged
merged 1 commit into from
Jun 20, 2024
Merged

[red-knot] Add tracing to Salsa queries #11949

merged 1 commit into from
Jun 20, 2024

Conversation

MichaReiser
Copy link
Member

Summary

This PR adds tracing instrumentation to Salsa queries.

I intentionally didn't use the #[tracing::instrument] attribute because, depending on the ordering, the attribute is applied to the query implementation only or the query implementation and the get function that retrieves the cached value or calls the query implementation.
Using debug_span! avoids the ambiguity and has the added benefit that we can call the DebugWithDb implementation instead of just debug on the arguments.

@MichaReiser MichaReiser requested a review from carljm as a code owner June 20, 2024 11:22
@MichaReiser MichaReiser changed the base branch from main to salsa-9-red_knot_python_semantic June 20, 2024 11:23
@MichaReiser MichaReiser added the red-knot Multi-file analysis & type inference label Jun 20, 2024
Base automatically changed from salsa-9-red_knot_python_semantic to main June 20, 2024 11:24
@MichaReiser MichaReiser merged commit b456051 into main Jun 20, 2024
20 checks passed
@MichaReiser MichaReiser deleted the salsa-tracing branch June 20, 2024 11:33
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant