-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cloudflare): instrument scheduled handler
- Loading branch information
1 parent
19bdb13
commit ac4c2b3
Showing
7 changed files
with
148 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { IncomingRequestCfProperties } from '@cloudflare/workers-types'; | ||
|
||
import type { Scope } from '@sentry/types'; | ||
import { winterCGRequestToRequestData } from '@sentry/utils'; | ||
|
||
/** | ||
* Set cloud resource context on scope. | ||
*/ | ||
export function addCloudResourceContext(scope: Scope): void { | ||
scope.setContext('cloud_resource', { | ||
'cloud.provider': 'cloudflare', | ||
}); | ||
} | ||
|
||
/** | ||
* Set culture context on scope | ||
*/ | ||
export function addCultureContext(scope: Scope, cf: IncomingRequestCfProperties): void { | ||
scope.setContext('culture', { | ||
timezone: cf.timezone, | ||
}); | ||
} | ||
|
||
/** | ||
* Set request data on scope | ||
*/ | ||
export function addRequest(scope: Scope, request: Request): void { | ||
scope.setSDKProcessingMetadata({ request: winterCGRequestToRequestData(request) }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24347,10 +24347,10 @@ [email protected], mini-css-extract-plugin@^2.5.2: | |
dependencies: | ||
schema-utils "^4.0.0" | ||
|
||
[email protected].0, miniflare@^3.20240718.0: | ||
version "3.20240718.0" | ||
resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-3.20240718.0.tgz#41561c6620b2b15803f5b3d2e903ed3af40f3b0b" | ||
integrity sha512-TKgSeyqPBeT8TBLxbDJOKPWlq/wydoJRHjAyDdgxbw59N6wbP8JucK6AU1vXCfu21eKhrEin77ssXOpbfekzPA== | ||
[email protected].1: | ||
version "3.20240718.1" | ||
resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-3.20240718.1.tgz#26ccb95be087cd99cd478dbf2e3a3d40f231bf45" | ||
integrity sha512-mn3MjGnpgYvarCRTfz4TQyVyY8yW0zz7f8LOAPVai78IGC/lcVcyskZcuIr7Zovb2i+IERmmsJAiEPeZHIIKbA== | ||
dependencies: | ||
"@cspotcode/source-map-support" "0.8.1" | ||
acorn "^8.8.0" | ||
|
@@ -34118,10 +34118,10 @@ workerpool@^6.4.0: | |
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.4.0.tgz#f8d5cfb45fde32fa3b7af72ad617c3369567a462" | ||
integrity sha512-i3KR1mQMNwY2wx20ozq2EjISGtQWDIfV56We+yGJ5yDs8jTwQiLLaqHlkBHITlCuJnYlVRmXegxFxZg7gqI++A== | ||
|
||
wrangler@^3.65.1: | ||
version "3.65.1" | ||
resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-3.65.1.tgz#493bd92b504f9f056cd57bbe2d430797600c914b" | ||
integrity sha512-Z5NyrbpGMQCpim/6VnI1im0/Weh5+CU1sdep1JbfFxHjn/Jt9K+MeUq+kCns5ubkkdRx2EYsusB/JKyX2JdJ4w== | ||
wrangler@^3.67.1: | ||
version "3.67.1" | ||
resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-3.67.1.tgz#c9bb344b70c8c2106ad33f03beaa063dd5b49526" | ||
integrity sha512-lLVJxq/OZMfntvZ79WQJNC1OKfxOCs6PLfogqDBuPFEQ3L/Mwqvd9IZ0bB8ahrwUN/K3lSdDPXynk9HfcGZxVw== | ||
dependencies: | ||
"@cloudflare/kv-asset-handler" "0.3.4" | ||
"@esbuild-plugins/node-globals-polyfill" "^0.2.3" | ||
|
@@ -34130,14 +34130,15 @@ wrangler@^3.65.1: | |
chokidar "^3.5.3" | ||
date-fns "^3.6.0" | ||
esbuild "0.17.19" | ||
miniflare "3.20240718.0" | ||
miniflare "3.20240718.1" | ||
nanoid "^3.3.3" | ||
path-to-regexp "^6.2.0" | ||
resolve "^1.22.8" | ||
resolve.exports "^2.0.2" | ||
selfsigned "^2.0.1" | ||
source-map "^0.6.1" | ||
unenv "npm:[email protected]" | ||
workerd "1.20240718.0" | ||
xxhash-wasm "^1.0.1" | ||
optionalDependencies: | ||
fsevents "~2.3.2" | ||
|