[sdk-trace] no type validation in places where it is common to pass caught Error
s
#4998
Labels
bug
Something isn't working
pkg:sdk-trace-base
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
What happened?
Description
When calling
span.setStatus({ code: SpanStatusCode.ERROR, message: message})
it could be common to pass a caughtError
as the message, like so:Expected Result
message
is dropped as being not astring
, adiag.warn
is logged.Actual Result
message
which should be astring
gets passed all though the SDK, to the exporter, and eventually getsJSON.stringify
d into an empty object, the OTel collector then rejects the whole trace export message with a400 Bad Request
.Additional Details
This is happening in renovate bot where they catch an error and pass it directly as a
message
insetStatus
: https://github.com/renovatebot/renovate/blob/5ca09edcbf454fc1b1ae9272ab240cd03d8d2e75/lib/instrumentation/index.ts#L145-L153The text was updated successfully, but these errors were encountered: