Skip to content

Commit

Permalink
When OTel logs are enabled, still send exceptions as events and not a…
Browse files Browse the repository at this point in the history
…s OTel logs.
  • Loading branch information
leandro-godon committed Mar 26, 2024
1 parent 21abf2f commit accc3d8
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 accc3d8

Please sign in to comment.