-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(cloudflare): Add cloudflare sdk scaffolding #12953
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
16eed29 to
8241555
Compare
| const cachedDecision = _headersUrlMap.get(url); | ||
| if (cachedDecision !== undefined) { | ||
| return cachedDecision; | ||
| } |
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.
l: could extract the cache decision logic into a helper function and reuse it in _shouldCreateSpan
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.
Will do this in a follow-up PR
| const shouldCreateSpanForRequest = options.shouldCreateSpanForRequest; | ||
|
|
||
| const _createSpanUrlMap = new LRUMap<string, boolean>(100); | ||
| const _headersUrlMap = new LRUMap<string, boolean>(100); |
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.
Just to understand it better, how did you come up with cache size 100?
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.
This was arbitrary, it matches the implementation for vercel-edge fetch integration. We can always adjust this in the future.
chargome
left a comment
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 🚀
ref #12620
This PR adds basic scaffolding for the cloudflare workers SDK. Most of this is based on
@sentry/vercel-edge.This adds:
You'll notice that there is no
initmethod defined or exported from the SDK. This is on purpose!initfor cloudflare workers will work a bit differently than the other SDKs, so I wanted to address it differently on purpose. You'll see what that looks like in the next PR!