# 🧩 Add -sentry-extra-trace flag for enhanced Sentry error tracing
#203
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