Skip to content

Conversation

Jibola
Copy link
Contributor

@Jibola Jibola commented Jan 7, 2025

No description provided.

Copy link
Collaborator

@timgraham timgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a setting to let users disable telemetry? Should we disable telemetry during development of this library (i.e. running the Django test suite). Two things I've done in other backends: https://github.com/cockroachdb/django-cockroachdb/blob/00c9e2a13adb00a6f89d0eda725d675238e4611e/django_cockroachdb/base.py#L64-L67

return MongoClient(**conn_params, driver=self._driver_info())

def _driver_info(self):
return DriverInfo("django-mongodb", metadata.version("django-mongodb"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using importlib.metadata you could use from . import __version__ as django_mongodb_version (this is what I used in other libraries).

return MongoClient(**conn_params)
return MongoClient(**conn_params, driver=self._driver_info())

def _driver_info(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to be a separate method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but I like the separation is all.

@Jibola
Copy link
Contributor Author

Jibola commented Jan 7, 2025

Do we need a setting to let users disable telemetry? Should we disable telemetry during development of this library (i.e. running the Django test suite). Two things I've done in other backends: https://github.com/cockroachdb/django-cockroachdb/blob/00c9e2a13adb00a6f89d0eda725d675238e4611e/django_cockroachdb/base.py#L64-L67

That's a good idea. I'll add an env flag check.

As a general FYI, In other repos we don't make it optional.

@Jibola Jibola merged commit 082f12d into main Jan 7, 2025
11 checks passed
@timgraham timgraham deleted the driver-info branch January 8, 2025 19:00
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

Successfully merging this pull request may close these issues.

2 participants