Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@mattjohnsonpint
Copy link
Contributor

@mattjohnsonpint mattjohnsonpint commented Jul 3, 2025

  • Improves Sentry integration by capturing errors directly, rather than via logging integration
  • Adds Sentry's HTTP server integration
  • Adds support for context-aware Sentry hubs, to prevent mixing results between goroutines
  • Ensures panics are captured to Sentry
  • Simplifies the internal logger API
  • Reduces transaction sampling for Sentry to 20% by default
  • Misc cleanup/refactoring

@mattjohnsonpint mattjohnsonpint requested review from a team and Copilot July 3, 2025 19:14
@linear
Copy link

linear bot commented Jul 3, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances Sentry error handling and streamlines the logger API across the runtime.

  • Switched from routing errors via zerolog-sentry to direct Sentry captures and context-aware hubs
  • Added Sentry HTTP middleware integration in the HTTP server
  • Simplified the internal logger API (Warn, Error, Fatal) and replaced many logger.Err calls with logger.Error(ctx, err)

Reviewed Changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runtime/wasmhost/wasmhost.go Updated fatal logger calls to new signature
runtime/wasmhost/hostfns.go Changed panic and error logs to logger.Error and added utils.CaptureError
runtime/wasmhost/fncall.go Updated error logging in wasm function calls
runtime/utils/utils.go Removed obsolete TrimStringBefore, added env-var helpers (GetIntFromEnv, etc.)
runtime/utils/strings.go Reintroduced TrimStringBefore in a dedicated module
runtime/utils/sentry.go Renamed init/flush to InitializeSentry/FinalizeSentry, added CaptureError and CaptureWarning
runtime/storage/* Updated all .Err logging calls to Error(ctx, err)
runtime/sqlclient/* Switched transaction rollback logs to new logger API
runtime/services/services.go Removed legacy logger.Close() call
runtime/secrets/kubernetes.go Updated Kubernetes client error logs to new API
runtime/pluginmanager/loader.go Switched plugin load/unload logs to logger.Error
runtime/middleware/* Updated JWT and auth-key error logs to Error(ctx, err)
runtime/manifestdata/manifestdata.go Replaced Err with Error for manifest load/unload logs
runtime/main.go Updated Sentry init and flush calls to new names
runtime/logger/logger.go Overhauled logger initialization and removed zerolog-sentry integration; refactored Warn, Error, Fatal to accept error args
runtime/langsupport/executionplan.go Added utils.CaptureError in recover block
runtime/httpserver/server.go Added Sentry HTTP middleware and reordered middleware stacking
runtime/httpserver/health.go Replaced Err with Error for health endpoint logs
runtime/hostfunctions/system.go Updated system host function error logs to new API
runtime/graphql/* Updated GraphQL request error logs to logger.Error
runtime/graphql/datasource/planner.go Updated planner error logs to new logger calls
runtime/go.mod Removed zerolog-sentry dependency
runtime/envfiles/* Updated env-file load logs to new Warn(ctx, err) API
runtime/dgraphclient/dgraph.go Switched discard logs to Warn(ctx, err)
runtime/db/* Updated DB warning/error logs to new API
runtime/app/app.go Adjusted comment referencing utils
runtime/actors/* Integrated context-aware Sentry hubs and updated logs
Comments suppressed due to low confidence (1)

runtime/utils/utils.go:19

  • The new functions use os.Getenv but the os package isn't imported; please add import "os" to this file.
	"time"

@mattjohnsonpint mattjohnsonpint enabled auto-merge (squash) July 3, 2025 19:18
@mattjohnsonpint mattjohnsonpint merged commit 2a2089c into main Jul 3, 2025
33 checks passed
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-3512-rework-sentry-error-reporting branch July 3, 2025 19:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants