You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While implementing the ObservabilityService interface to work with OpenTelemetry, I noticed that when errors happen during the several operations in cloudevents (client.goSend method), the callback in the observability service func(errOrResult error) is invoked with an empty error. Depending on the use case, developers would want to maybe mark the span created by the ObservabilityService as failed, but without the error result it's not possible to figure it out.
I started debugging to see why, and I found out that in several places the callback is called in a defer but before the error is actually collected. For example, here
The text was updated successfully, but these errors were encountered:
While implementing the
ObservabilityService
interface to work with OpenTelemetry, I noticed that when errors happen during the several operations in cloudevents (client.go
Send
method), the callback in the observability servicefunc(errOrResult error)
is invoked with an empty error. Depending on the use case, developers would want to maybe mark the span created by the ObservabilityService as failed, but without the error result it's not possible to figure it out.I started debugging to see why, and I found out that in several places the callback is called in a
defer
but before the error is actually collected. For example, hereThe text was updated successfully, but these errors were encountered: