mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
86cd873e67
* Add span and annotate errors for validating beacon attestations * fix test
18 lines
383 B
Go
18 lines
383 B
Go
package traceutil
|
|
|
|
import (
|
|
"go.opencensus.io/trace"
|
|
)
|
|
|
|
// AnnotateError on span. This should be used any time a particular span experiences an error.
|
|
func AnnotateError(span *trace.Span, err error) {
|
|
if err == nil {
|
|
return
|
|
}
|
|
span.AddAttributes(trace.BoolAttribute("error", true))
|
|
span.SetStatus(trace.Status{
|
|
Code: trace.StatusCodeUnknown,
|
|
Message: err.Error(),
|
|
})
|
|
}
|