Skip to content

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

Merged
MichaReiser merged 1 commit intomainfrom
salsa-tracing
Jun 20, 2024
Merged

[red-knot] Add tracing to Salsa queries#11949
MichaReiser merged 1 commit intomainfrom
salsa-tracing

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 ty 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
@MichaReiser MichaReiser deleted the salsa-tracing branch June 20, 2024 11:33
@github-actions
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

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant