Skip to content

Commit

Permalink
Merge pull request #631 from embrace-io/leandro/use_v1_for_excpetions
Browse files Browse the repository at this point in the history
Send exceptions as events even if OTel logs are enabled
  • Loading branch information
leandro-godon committed Mar 26, 2024
2 parents 21abf2f + accc3d8 commit 2b85acd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ internal class CompositeLogService(
properties
)
} else {
v2LogService.logException(
// Currently, the backend is not processing exceptions as OTel logs, so we must
// use v1. When the backend is ready, this must be replaced with a call
// to v2LogService.logException().
v1LogService.log(
message = message,
severity = severity,
type = type,
logExceptionType = logExceptionType,
properties = properties,
stackTraceElements = stackTraceElements,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ internal class CompositeLogServiceTest {
exceptionName = null,
exceptionMessage = null
)
assertEquals(0, v1LogService.loggedMessages.size)
assertEquals(1, v2LogService.loggedExceptions.size)
// Currently, log exceptions must be sent through v1. Invert this validation once
// the backend can read exceptions sent as OTel logs
assertEquals(1, v1LogService.loggedMessages.size)
assertEquals(0, v2LogService.loggedExceptions.size)
}

@Test
Expand Down

0 comments on commit 2b85acd

Please sign in to comment.