feat: add sentry to achievements worker #3640
Merged
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.
What does this PR do?
🤖 Generated by Copilot at c07ced5
This pull request adds Sentry tracing and error monitoring to the achievements worker, and refactors the handler logic to use the new
Achievement
class and common utilities. It also updates the environment variables, thepackage.json
script, thewrangler.toml
file, and thepnpm-lock.yaml
file to support the Sentry integration.Related issues
Fixes # (issue)
Type of change
Explanation of the changes
🤖 Generated by Copilot at c07ced5
@sentry/tracing
module to start and finish transactions and spans for each handler function (link, link, link, link, link, link, link, link, link, link, link, link)toucan-js
module to create a Sentry instance and wrap the fetch event handler (link, link)@lenster/data/errors
and@lenster/lib/response
modules to handle errors and responses consistently (link, link)buildRequest
to create aWorkerRequest
object from the original request, the environment variables, the execution context, and the Sentry instance (link, link)Env
toWorkerRequest
in all handler functions and use therequest.env
object to access the environment variables (link, link, link, link, link, link, link, link, link)itty-router
to use named imports instead of default import and add ahead
handler and a catch-all handler to the router configuration (link, link)message
and aversion
property to the root handler response (link)Emoji
🐛🚀🧹