Repository navigation
crash: add crash keys and re-export code location and exception keys - #28
Conversation
lantern-box reports a Go runtime crash dump on its next start. To make those reports groupable it tags them with the crashing function, file, line and panic message; OTel has standard keys for each (code.function.name, code.file.path, code.line.number, exception.type, exception.message), so re-export those. crash.type (already emitted) and crash.signature have no OTel equivalent and go in custom.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AECMJ3ddHpHNv9TsAZEndh
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe package adds exported attribute keys for Go runtime crash classification and signatures, and re-exports OpenTelemetry code-location and exception attributes. ChangesAttribute key exports
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The added exports match their documented crash and OpenTelemetry attribute contracts. No concrete merge-blocking behavior is indicated, so the change is ready to merge. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The changes add attribute-name constants without adding crash collection, data export, executable entrypoints, or privileges. No material security risk is introduced by these declarations. Privacy and access controls for downstream crash reporting remain outside this change. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Address review on #343: - Attribute keys come from getlantern/semconv, preferring standard OTel keys: exception.type / exception.message for the panic line, code.function.name / code.file.path / code.line.number (int) for the crash site. crash.type and crash.signature are custom keys added in getlantern/semconv#28; semconv is pinned to that PR's commit until it merges. - panic("") prints "panic: ", which TrimSpace leaves as "panic:", so the prefix check now matches the bare "panic:" / "fatal error:" forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AECMJ3ddHpHNv9TsAZEndh
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The ExceptionTypeKey documentation recommends values that conflict with its OTel semantics.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds canonical semantic-convention keys for structured crash reporting and grouping.
Changes:
- Re-exports OTel code-location and exception keys.
- Adds Lantern-specific crash type and signature keys.
| File | Description |
|---|---|
standard.go |
Re-exports standard code and exception attributes. |
custom.go |
Defines custom crash attributes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
exception.type is the exception's dynamic type (e.g. runtime.boundsError), which a Go crash dump doesn't print; "panic" vs "fatal error" is the crash mechanism, not a type, so lantern-box won't emit it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AECMJ3ddHpHNv9TsAZEndh
- Hex and decimal runs were normalised in two passes, so the digit pass rewrote the "0" of the hex placeholder and an address came out as "Nx?". One regex with hex first now yields "0x?". - Stop emitting exception.type: OTel defines it as the exception's dynamic type, which a crash dump doesn't print. "panic" vs "fatal error" stays in the signature. semconv bumped to getlantern/semconv#28's head, which drops the re-export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AECMJ3ddHpHNv9TsAZEndh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AECMJ3ddHpHNv9TsAZEndh

What
Adds the keys for lantern-box crash reports (getlantern/lantern-box#343):
Re-exported from OTel semconv v1.34.0 (
standard.go):CodeFunctionNameKey(code.function.name)CodeFilePathKey(code.file.path)CodeLineNumberKey(code.line.number)ExceptionMessageKey(exception.message)Custom (
custom.go, new "Process crashes" group):CrashTypeKey(crash.type). lantern-box already emits this, currently as a hardcoded string.CrashSignatureKey(crash.signature) holds the panic line with numbers normalised, plus the crashing function. The same bug then groups as one row even when the slice bounds or addresses differ.Why
When lantern-box restarts it reports the Go crash dump from the previous run. Today the only attribute is
crash.type, so crashes can't be grouped or alerted on per bug. lantern-box#343 parses the dump into these attributes. Following the rules in AGENTS.md, it uses the standardcode.*andexception.*keys wherever OTel defines one. Only the two concepts OTel lacks are custom.exception.typeis deliberately left out. OTel defines it as the exception's dynamic type (e.g.runtime.boundsError), which a Go crash dump doesn't print.Pre-PR review (local Codex gate)
CODEX GATE: verdict=approve critical=0 important=0 minor=0approve🤖 Generated with Claude Code
https://claude.ai/code/session_01AECMJ3ddHpHNv9TsAZEndh