-
Notifications
You must be signed in to change notification settings - Fork 7
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
Feat/telemetry #111
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.
Mostly LGTM! See comment in this PR + backend comments
cleanlab_studio/internal/api/api.py
Outdated
_ = requests.post( | ||
f"{cli_base_url}/telemetry", | ||
data=traceback.format_exc(), | ||
headers=_construct_headers(api_key), | ||
) |
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.
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
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.
ah thanks that's a good point.
Fixed this, and also added function name and args to be sent to backend
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.
if this looks good now, I'll add it to all the functions that make api calls to our backend
cleanlab_studio/internal/api/api.py
Outdated
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) |
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.
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
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