mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-19 04:26:34 +00:00
Migrate to containerd v1.7.0 and update dependencies
* Updates containerd to v1.7.0 and new binary for 32-bit Arm OSes. * Updates Go dependencies - openfaas and external Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
9efd019e86
commit
c41c2cd9fc
31
vendor/github.com/Microsoft/hcsshim/internal/oc/span.go
generated
vendored
31
vendor/github.com/Microsoft/hcsshim/internal/oc/span.go
generated
vendored
@ -1,9 +1,14 @@
|
||||
package oc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Microsoft/hcsshim/internal/log"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
|
||||
var DefaultSampler = trace.AlwaysSample()
|
||||
|
||||
// SetSpanStatus sets `span.SetStatus` to the proper status depending on `err`. If
|
||||
// `err` is `nil` assumes `trace.StatusCodeOk`.
|
||||
func SetSpanStatus(span *trace.Span, err error) {
|
||||
@ -15,3 +20,29 @@ func SetSpanStatus(span *trace.Span, err error) {
|
||||
}
|
||||
span.SetStatus(status)
|
||||
}
|
||||
|
||||
// StartSpan wraps "go.opencensus.io/trace".StartSpan, but, if the span is sampling,
|
||||
// adds a log entry to the context that points to the newly created span.
|
||||
func StartSpan(ctx context.Context, name string, o ...trace.StartOption) (context.Context, *trace.Span) {
|
||||
ctx, s := trace.StartSpan(ctx, name, o...)
|
||||
return update(ctx, s)
|
||||
}
|
||||
|
||||
// StartSpanWithRemoteParent wraps "go.opencensus.io/trace".StartSpanWithRemoteParent.
|
||||
//
|
||||
// See StartSpan for more information.
|
||||
func StartSpanWithRemoteParent(ctx context.Context, name string, parent trace.SpanContext, o ...trace.StartOption) (context.Context, *trace.Span) {
|
||||
ctx, s := trace.StartSpanWithRemoteParent(ctx, name, parent, o...)
|
||||
return update(ctx, s)
|
||||
}
|
||||
|
||||
func update(ctx context.Context, s *trace.Span) (context.Context, *trace.Span) {
|
||||
if s.IsRecordingEvents() {
|
||||
ctx = log.UpdateContext(ctx)
|
||||
}
|
||||
|
||||
return ctx, s
|
||||
}
|
||||
|
||||
var WithServerSpanKind = trace.WithSpanKind(trace.SpanKindServer)
|
||||
var WithClientSpanKind = trace.WithSpanKind(trace.SpanKindClient)
|
||||
|
Reference in New Issue
Block a user