feat: Add sentry to capture errors for 2wp-api development env#450
Open
annipi wants to merge 1 commit into
Open
feat: Add sentry to capture errors for 2wp-api development env#450annipi wants to merge 1 commit into
annipi wants to merge 1 commit into
Conversation
Dependency ReviewThe following issues were found:
|
768069c to
562a673
Compare
|
Dominikkq
requested changes
Mar 10, 2026
Dominikkq
left a comment
There was a problem hiding this comment.
move direct sentry imports out of controllers/services into a shared error-reporter wrapper so business code doesnt depend on the SDK directly and we keep one integration point for future filtering/sanitization/changes
| import {ApplicationConfig, TwpapiApplication} from './application'; | ||
| import {DaemonRunner} from './daemon-runner'; | ||
| import { ENVIRONMENT_PRODUCTION } from './constants'; | ||
| import './instrument'; |
There was a problem hiding this comment.
move this import to after config() runs
| const Sentry = require("@sentry/node"); | ||
|
|
||
| const dsn = process.env.SENTRY_DSN; | ||
| if (!dsn) { |
| resolve(responseAddress); | ||
| }) | ||
| .catch(() => { | ||
| Sentry.captureException(`Error getting address ${address}`); |
There was a problem hiding this comment.
sentry here should capture reason too, like on line 52
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


SUP-260
Adding SENTRY_DSN env variable to set sentry DSN for each environment.
Project 2wp-api-dev issues
