mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 11:11:20 +00:00
15 lines
354 B
Go
15 lines
354 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) {
|
||
|
span.AddAttributes(trace.BoolAttribute("error", true))
|
||
|
span.SetStatus(trace.Status{
|
||
|
Code: trace.StatusCodeUnknown,
|
||
|
Message: err.Error(),
|
||
|
})
|
||
|
}
|