mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 13:18:57 +00:00
546196a6fa
* e2e docs * slasher docs * Merge branch 'other-package-godocs' of github.com:prysmaticlabs/prysm into other-package-godocs * all validator package comments * Merge branch 'master' into other-package-godocs * completed all other packages * Merge branch 'master' into other-package-godocs * Merge refs/heads/master into other-package-godocs
19 lines
459 B
Go
19 lines
459 B
Go
// Package traceutil includes useful functions for opentracing annotations.
|
|
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(),
|
|
})
|
|
}
|