feat: Sentry error tracking integration#76
Open
derrickmehaffy wants to merge 10 commits into
Open
Conversation
Non-blocking async error reporting to Sentry with fail-safe wrapping. Includes configurable DSN, source context upload, and /f admin sentrytest command.
Config loads in enable() during start(), not setup(). Calling ConfigManager.get().sentry() in setup() returned null.
Fix task dependency for all Sentry tasks on generateBuildInfo. Auto-upload source bundle after every build via finalizedBy.
Tags: hytale.server.version, plugin.version, java.version, os Context: structured server info with CPU count and max memory
Includes server_name, max_players, and MOTD from HytaleServerConfig.
Maps ManifestUtil.getPatchline() to Sentry environments: release → production, pre-release → staging, dev → development. Falls back to config value if detection fails.
Lists all loaded plugins with name, version, and state. Refreshed on BootEvent for a complete picture after all plugins load.
Change HashMap type from <String, String> with unsafe double-cast to <String, Object> which setContexts() accepts directly. Add total_count field and debug logging for verification.
Add ErrorHandler utility class that centralizes error handling — all errors are now logged to console AND reported to Sentry. Convert ~190 Logger.severe() calls in catch blocks across ~50 files to route through ErrorHandler. Wrap scheduled tasks with wrapTask() to prevent silent thread death, guard async futures, and isolate shutdown steps. Add pre-init error buffering to SentryIntegration so errors during config/data loading (before Sentry initializes) are captured and flushed once Sentry is ready, tagged with pre_init:true. Wire WriteResult.Failure storage errors (with nullable Exception cause) through to Sentry via new report(@nullable) overload.
Move sentry configuration from standalone config/sentry.json into a nested "sentry" section within config/debug.json. Auto-migration reads existing sentry.json values on first load and deletes the old file. Add /f admin sentry command for server owners to view status, opt out, or opt back in to error reporting at runtime without editing config files. Remove SentryConfig class, update ConfigManager, SentryIntegration, and all callers to use DebugConfig for sentry settings.
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.
Summary
ErrorHandlerutility replaces ~190Logger.severe()calls across ~50 files — all errors now report to Sentry alongside console loggingpre_init:truetag)config/debug.jsonunder a"sentry"section (no separate file)config/sentry.jsonvalues are read intodebug.jsonon first load, old file deleted/f admin sentrycommand lets server owners view status and opt out/in at runtime/f admin sentrytestsends a test event to verify the integrationTest plan
./gradlew :HyperFactions:compileJavacompiles cleanly/f admin sentrytestsends test event to Sentry dashboarddebug.jsongenerates with"sentry"section, nosentry.jsoncreatedsentry.jsonin config dir, restart — values migrate intodebug.json, old file deleted/f admin sentryshows correct status/f admin sentry disablecloses Sentry and saves config/f admin sentry enablere-initializes Sentry and saves config