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

Feat/telemetry #111

Closed
wants to merge 12 commits into from
Closed

Feat/telemetry #111

wants to merge 12 commits into from

Conversation

clu0
Copy link
Contributor

@clu0 clu0 commented Jul 6, 2023

decorator that wraps functions we want to track and sends stack trace to backend if error raised

backend pr: https://github.com/cleanlab/cleanlab-studio-backend/pull/544

@clu0 clu0 marked this pull request as draft July 6, 2023 18:20
@clu0 clu0 marked this pull request as ready for review July 6, 2023 22:57
@clu0 clu0 requested review from axl1313 and ryansingman July 6, 2023 22:57
Copy link
Member

@ryansingman ryansingman left a comment

Choose a reason for hiding this comment

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

Mostly LGTM! See comment in this PR + backend comments

Comment on lines 40 to 44
_ = requests.post(
f"{cli_base_url}/telemetry",
data=traceback.format_exc(),
headers=_construct_headers(api_key),
)
Copy link
Member

Choose a reason for hiding this comment

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

we don't want failed telemetry to ever result in an error visible to users, so let's make sure that this is wrapped in a try-except. one example I can think of is if the user is having network issues. their first request will error out, then they'll see a network error raised from a telemetry request. this would be a bit confusing to users -- best to avoid that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah thanks that's a good point.

Fixed this, and also added function name and args to be sent to backend

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if this looks good now, I'll add it to all the functions that make api calls to our backend

@clu0 clu0 requested a review from ryansingman July 7, 2023 02:53
Comment on lines 42 to 44
arg_list = [repr(arg) for arg in args]
arg_list.extend(f"{k}={v!r}" for k, v in kwargs.items())
arg_str = ", ".join(arg_list)
Copy link
Member

Choose a reason for hiding this comment

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

consider that this is considerably more invasive than just sending the traceback. would recommend checking w Anish to see if this is what we want to do at the moment

@clu0 clu0 requested a review from anishathalye July 7, 2023 16:52
@anishathalye anishathalye deleted the feat/telemetry branch July 13, 2023 15:02
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.

3 participants