Created
May 23, 2018 13:06
-
-
Save slok/8fa69faac0d19cbfc0356758c74bbd59 to your computer and use it in GitHub Desktop.
kooper handler opentracing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hand := &handler.HandlerFunc{ | |
AddFunc: func(ctx context.Context, obj runtime.Object) error { | |
// Get the parent span. | |
pSpan := opentracing.SpanFromContext(ctx) | |
// Create a new span. | |
span := tracer.StartSpan("AddFunc", opentracing.ChildOf(pSpan.Context())) | |
defer span.Finish() | |
// Do stuff... | |
return nil | |
}, | |
DeleteFunc: func(ctx context.Context, s string) error { | |
// Get the parent span. | |
pSpan := opentracing.SpanFromContext(ctx) | |
// Create a new span. | |
span := tracer.StartSpan("DeleteFunc", opentracing.ChildOf(pSpan.Context())) | |
defer span.Finish() | |
// Do stuff... | |
return nil | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment