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

Python SDK version 1.1 #263

Merged
merged 14 commits into from
Jul 7, 2021
Merged

Python SDK version 1.1 #263

merged 14 commits into from
Jul 7, 2021

Conversation

RyanGWU82
Copy link
Contributor

🧰 What's being changed?

This is mostly refactoring, code cleanup, and maintainability improvements, in preparation for larger changes coming later this week.
• Fix RM-1310: Improve our ability to debug the Python SDK by adding a logger and by creating a place to override the Metrics API URL (so ReadMe engineers can test against their local Metrics installation)
• Fix RM-1314: batching prevents the last few requests from reaching our server; the new atexit_handler function allows us to flush any remaining logs before the process shuts down.
• Refactored the code for making the ReadMe API post; moved it to its own file.
• Added a timeout parameter for API calls, so that the client doesn't wait forever if the API is unresponsive.

I've also bumped the version to 1.1.0.

Roadmap for changes coming over the next few days:
• Version 1.1.0: this release, mostly refactoring and maintainability
• Version 1.2.0: add support for the new style of redacted fields—instead of disappearing from the payload entirely, they'll be sent as [REDACTED], or for strings, [REDACTEDnn] (nn = length of the redacted string)
• Version 2.0.0: add new adapters for Flask and Django so that clients can call the grouping function from within their application context (instead of running in WSGI middleware), which will make this a lot more usable for more substantial applications.

🧪 Testing

Tested on a branch of the new metrics-test-python service, which I had written earlier this month.

@RyanGWU82
Copy link
Contributor Author

@domharrington @emilyskuo Gentle nudge on this PR, thanks!

Copy link
Member

@emilyskuo emilyskuo left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@RyanGWU82 RyanGWU82 changed the base branch from main to python-next July 7, 2021 23:09
@RyanGWU82 RyanGWU82 merged commit 14a6549 into python-next Jul 7, 2021
@RyanGWU82 RyanGWU82 deleted the version-1.1 branch July 7, 2021 23:10
domharrington pushed a commit that referenced this pull request Apr 19, 2022
* style: fix linter errors in tests

* docs: correct inline documentation for MetricsApiConfig class

* refactor: move METRICS_API to MetricsApiConfig so that it can be overridden during SDK development

* feat: add a logger for debugging

* refactor: move submission code to its own file

* feat: add timeout parameter

* fix: remove unnecessary debugging statements

* feat: when the process is exiting, send any queued requests and wait for all outstanding network calls to complete

* refactor: move ALLOWED_HTTP_HOSTS enforcement into the core Metrics processing object, so it can be shared across multiple implementations (coming soon)

* docs: clean up README.md and make sure all parameters are documented

* feat: make it easier for users to override the new `timeout` parameter

* release: bump version to 1.1.0

* Ignore .envrc files (sometimes used in Python development)

* style: proper formatting with black
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