Skip to content

Commit

Permalink
Fix error details not being logged in the tracing's span event
Browse files Browse the repository at this point in the history
The span event "error" logs a field called "error" that is expected to contain the error's details, but is instead displaying as a boolean on Honeycomb. This is causing us to miss some important information when debuging an error span.

This issue seems to be that a field called "error" is already definded as boolean. A solution would be to rename this field, in this specific span event, to something like "error.details" (we already have "error.id" and "error.kind").
  • Loading branch information
filipewl committed Sep 14, 2023
1 parent 750d149 commit 8dd6a12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Error tracing spans not logging the details.

## [6.45.20] - 2023-08-30
### Changed
- Remove sampling decision from runtime
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/errorReporting/ErrorReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ErrorReport extends ErrorReportBase {
}

const serializableError = this.toObject()
span.log({ event: 'error', ...indexedLogs, error: serializableError })
span.log({ event: 'error', ...indexedLogs, 'error.details': serializableError })

if (logger && this.shouldLogToSplunk(span)) {
logger.error(serializableError)
Expand Down

0 comments on commit 8dd6a12

Please sign in to comment.