-
Notifications
You must be signed in to change notification settings - Fork 11
feat(FIR-9997): Usage tracking #172
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left a couple of comments
src/firebolt/utils/usage_tracker.py
Outdated
| connectors = detect_connectors() | ||
| logger.debug("Detected running from packages: %s", str(connectors)) | ||
| # Override auto-detected connectors with info provided manually | ||
| if type(custom_connectors) == tuple: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if someone would pass
(
("connector1", "version1"),
("connector2", "version2")
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let's just enforce passing a list? And don't allow passing a single item
|
Kudos, SonarCloud Quality Gate passed! |








Tracking usage based on parsing the stack and detecting known integration signatures of file + function name.
Also allowing access for manual override/addition of connector information.
Addition of a UsageTracker instance to the Conection causes a diffferent garbage collection to trigger, therefore a warnings test also had to be reworked with a manual call to gc. Users still get a warning of an unclosed connection if their script exits without doing so. This change only affects how we test the warnings, not how the users of the SDK see them.