Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds Clerk telemetry using Speakeasy Hooks. Here's some test code to exercise the SDK that you can use to see what happens:
Test Code To Exercise the Clerk SDK. Run with `CLERK_TELEMETRY_DEBUG=1 python3 main.py` after launching a HTTP echo server on `localhost:3000`
If you want to actually see sampled events you'll probably have to list users in a loop there or disable the random sampler, or set the
samplingRate
to 1. I did it in a loop to exercise the samplers with the following results:Example request sent. `npm -g http-echo-server` is convenient if you don't want to implement a POST echo server using Python's `http.server`
Here's what we're adding:
sk
yetlocalStorage
to keep this but we don't have that and adding a~/.config/clerk/something.db
seems overly intrusiveCLERK_TELEMETRY_DISABLED=1
CLERK_TELEMETRY_DEBUG=1
Which places you should look hardest at:
sk_live_
. Should we adjust hooks so we can just not attach telemetry listeners at hook registration?ThreadPoolExecutor
. I just didn't do daemon threads, but theThreadPoolExecutor
code does add anatexit
handler to drain the pool on shutdown which still works.try-except
so that they never fail?