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

Databases other than default #23

Open
gabriel-v opened this issue Jun 22, 2023 · 3 comments
Open

Databases other than default #23

gabriel-v opened this issue Jun 22, 2023 · 3 comments

Comments

@gabriel-v
Copy link

Hi,

I got a bunch of different databases under the DATABASES django config, not only the default one. I use a custom router set in DATABASE_ROUTERS to pick what database to use - a different one might hit for each view / event.

  1. Where would I patch in a config option to overwrite what database should be tracked instead of default?
  2. Would you be interested in a change to track all databases by default? This would also require UI changes (a drop-down in the corner?)

Thanks!

@Tijani-Dia
Copy link
Owner

Tijani-Dia commented Jun 22, 2023

I've never really used it in a configuration with multiple databases except with the trackings database which we shouldn't track. However, I'm wondering why other databases aren't tracked by default. The logic to track a query is based on the request's path or the model being used. Can you please confirm this behavior?

Where would I patch in a config option to overwrite what database should be tracked instead of default?

I don't think it'd be an easy patch. May be though.

Would you be interested in a change to track all databases by default? This would also require UI changes (a drop-down in the corner?)

I'd say this would be the ideal solution and I think it makes sense to track other databases too.

I'll have at look at this for the next release. A PR would be welcome too!

@gabriel-v
Copy link
Author

Can you please confirm this behavior?

You're right - all databases are tracked. This works.

I guess it would be nice to track the database id for each query / query group - but I can usually understand the context and figure out the database from looking at routes and stack traces.

@Tijani-Dia
Copy link
Owner

all databases are tracked

Awesome!

I guess it would be nice to track the database id for each query / query group

I agree too.

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

No branches or pull requests

2 participants