citusdata / citusdata/activerecord-multi-tenant

Include original call-site in QueryMonitor

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
759
Forks
113
PR merge metrics
No merged PRs in 30d

Description

The next release is going to add a query monitor feature that hints you at queries that might be missing the tenant_id filter because there is no wrapping MultiTenant.with(..) block:

https://github.com/citusdata/activerecord-multi-tenant/commit/b048e43b07795d8643d6d65a7063986e6b2dadf2

It might be worthwhile to include the original call site, as proposed for Rails' own statement logging here: https://github.com/rails/rails/pull/26815

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing commit b048e43b07795d8643d6d65a7063986e6b2dadf2 and the linked Rails pull request about statement logging. Trace the QueryMonitor implementation and determine how the original call site can be surfaced. Done means queries reported by the monitor include their original call site.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres, rails, ruby
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.