mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
9935ca3733
* add tracing * monitoring pkg * move prom * Add client stats Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
19 lines
455 B
Go
19 lines
455 B
Go
// Package tracing includes useful functions for opentracing annotations.
|
|
package tracing
|
|
|
|
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(),
|
|
})
|
|
}
|