Skip to content

crash: add crash keys and re-export code location and exception keys - #28

Merged
myleshorton merged 2 commits into
mainfrom
afisk/crash-keys
Oct 3, 2026
Merged

myleshorton merged 2 commits into
mainfrom
afisk/crash-keys

Conversation

@myleshorton

@myleshorton myleshorton commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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 standard code.* and exception.* keys wherever OTel defines one. Only the two concepts OTel lacks are custom.

exception.type is 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)

  • Rounds: 1. Final: CODEX GATE: verdict=approve critical=0 important=0 minor=0
  • Exit: approve
  • Fixed: none
  • Dismissed: none

🤖 Generated with Claude Code

https://claude.ai/code/session_01AECMJ3ddHpHNv9TsAZEndh

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
Copilot AI balanced review requested due to automatic review settings October 3, 2026 13:16
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4db5679-6cde-443b-9b54-39f3067e0c50
📥 Commits

Reviewing files that changed from the base of the PR and between 90d475a and 3156e30.

📒 Files selected for processing (2)
  • custom.go
  • standard.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The package adds exported attribute keys for Go runtime crash classification and signatures, and re-exports OpenTelemetry code-location and exception attributes.

Changes

Attribute key exports

Layer / File(s) Summary
Add attribute key exports
custom.go, standard.go
custom.go adds CrashTypeKey and CrashSignatureKey. standard.go re-exports code function name, file path, line number, exception type, and exception message attributes.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: jay-418

Merge Risk: ⚪ Minimal · up to 3156e

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 Review

Security architecture risk: ⚪ Minimal · up to 3156e

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
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The directly demonstrated change is confined to the package’s exported naming contract. The constants themselves do not increase tenant, service, data-store, or environment access; downstream exposure depends on producers and exporters not assessed here.

Trust Boundaries and Controls

  • observed — The added declarations accept no inputs and perform no authorization, execution, or export. They neither introduce a trust-boundary crossing nor supply controls for handling crash values downstream.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: adding crash keys and re-exporting code-location and exception keys.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

myleshorton added a commit to getlantern/lantern-box that referenced this pull request Oct 3, 2026
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The ExceptionTypeKey documentation recommends values that conflict with its OTel semantics.

Review effort: Balanced
Findings: 1 Medium severity

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.

Comment thread standard.go Outdated
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
myleshorton added a commit to getlantern/lantern-box that referenced this pull request Oct 3, 2026
- 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
@myleshorton
myleshorton requested a balanced review from Copilot October 3, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The additions follow established semantic-convention structure and satisfy the linked crash-reporting requirements.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@myleshorton
myleshorton merged commit 94b11ff into main Oct 3, 2026
2 checks passed
myleshorton added a commit to getlantern/lantern-box that referenced this pull request Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants