mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-28 15:09:39 -08:00
ddefee52dc
Note that by just running `make update-go-deps`, the K8s Go client was set to `k8s.io/client-go v11.0.0+incompatible`. However, that doesn't play well with `k8s.io/apimachinery v0.18.5`. I the manually changed the Go client line to `k8s.io/client-go v0.18.5`, which made everything work. I guess Go Modules got confused by the ginormous v11.0.0 version tag. Or it is a problem that pulling k8s.io/client-go with git results in a rather old repo without the v0.18.5 tag. github.com/kubernetes/client-go has all the right tags. I actually don't understand how Go Modules still correctly figures out the source from the `k8s.io/client-go v0.18.5` line. If one of the reviewers could enlighten me, I'd much appreciate it. Signed-off-by: beorn7 <beorn@grafana.com>
18 lines
403 B
Go
18 lines
403 B
Go
package ext
|
|
|
|
import (
|
|
"github.com/opentracing/opentracing-go"
|
|
"github.com/opentracing/opentracing-go/log"
|
|
)
|
|
|
|
// LogError sets the error=true tag on the Span and logs err as an "error" event.
|
|
func LogError(span opentracing.Span, err error, fields ...log.Field) {
|
|
Error.Set(span, true)
|
|
ef := []log.Field{
|
|
log.Event("error"),
|
|
log.Error(err),
|
|
}
|
|
ef = append(ef, fields...)
|
|
span.LogFields(ef...)
|
|
}
|