# 🧩 Add -sentry-extra-trace flag for enhanced Sentry error tracing#203
Open
guillaumetorresani wants to merge 1 commit intoaptible:mainfrom
Open
# 🧩 Add -sentry-extra-trace flag for enhanced Sentry error tracing#203guillaumetorresani wants to merge 1 commit intoaptible:mainfrom
-sentry-extra-trace flag for enhanced Sentry error tracing#203guillaumetorresani wants to merge 1 commit intoaptible:mainfrom
Conversation
- Introduced `-sentry-extra-trace` flag for including stdout and stderr of failed jobs in Sentry events. - Updated README with examples of the new flag. - Enhanced logging to support additional trace information. - Added a `ringBuffer` implementation for capturing and retaining job outputs efficiently. - Updated dependencies and switched to `go 1.25.2`.
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.
🧠 Context
Currently, when Supercronic reports job failures to Sentry using the
-sentry-dsnflag, the job’sstdoutandstderroutputs are not included in the event data.This makes it difficult to diagnose failed jobs because important execution context is missing.
💡 Proposal
Introduce a new optional flag:
When enabled, Supercronic will capture and attach the latest
stdoutandstderroutput of failed jobs to the Sentry event’s extra field.This provides additional context for debugging without altering the normal logging behavior.
✅ Example usage
$ ./supercronic -sentry-dsn https://examplePublicKey@o0.ingest.sentry.io/0 -sentry-extra-trace true🧰 Technical changes
-sentry-extra-traceinmain.go.cron.go:ringBufferto capture recentstdoutandstderrlines (64 KB buffer).runJob()to return captured logs, exit code, and execution duration.-sentry-extra-traceis enabled.exec.Command.Start/Wait) into a helper functionhandleExecError().README.mdand dependencies (go.mod,go.sum).🚀 Benefits
📦 Example Sentry payload
{ "extra": { "job.exit_code": 1, "job.duration": "5.32s", "job.stdout": "Starting backup...\nConnecting to database...", "job.stderr": "pg_dump: connection failed: timeout" } }Closes #202