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

feat(debugging): automatically comment SQL queries #10433

Merged
merged 2 commits into from Jun 23, 2022
Merged

Conversation

macobo
Copy link
Contributor

@macobo macobo commented Jun 22, 2022

This adds a new dependency: sqlcommenter, which automatically appends
comments to sql queries generated by django.

See more documentation at https://google.github.io/sqlcommenter/python/django/#0

Release notes: Our postgres queries are now automatically commented with endpoints queries originate from. This will make it easier for self-hosted users to report and debug bugs or performance-related issues.

This adds a new dependency: sqlcommenter, which automatically appends
comments to sql queries generated by django.

See more documentation at https://google.github.io/sqlcommenter/python/django/#0
@macobo macobo added the highlight ⭐ Release highlight label Jun 23, 2022
@guidoiaquinti
Copy link
Contributor

For future reference, #7486 was the first attempt at this and #8690 the second. I have faith in the 3rd!

@guidoiaquinti
Copy link
Contributor

In the previous PR we ended up implementing our own middleware inspired by the one you are proposing to allow further customisations (redact PII, etc...) but also this solution looks fine for me.

@macobo
Copy link
Contributor Author

macobo commented Jun 23, 2022

Yep - this isn't ideal but also extremely low effort win. :)

@macobo macobo merged commit d67df65 into master Jun 23, 2022
@macobo macobo deleted the sqlcommenter2 branch June 23, 2022 08:51
@macobo
Copy link
Contributor Author

macobo commented Jul 28, 2022

Note for release:

Instrumentation improvement: We now automatically comment all SQL queries generated by posthog with tags. This helps track down performance issues on self-hosted instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
highlight ⭐ Release highlight
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants