conform to rename of OpenTracing tags for RPC endpoints and fix for c&p mistake in addsvc example
Bas van Beek
7 years ago
41 | 41 |
{
|
42 | 42 |
concatEndpoint = addsvc.MakeThriftConcatEndpoint(client)
|
43 | 43 |
concatEndpoint = limiter(concatEndpoint)
|
44 | |
sumEndpoint = circuitbreaker.Gobreaker(gobreaker.NewCircuitBreaker(gobreaker.Settings{
|
|
44 |
concatEndpoint = circuitbreaker.Gobreaker(gobreaker.NewCircuitBreaker(gobreaker.Settings{
|
45 | 45 |
Name: "Concat",
|
46 | 46 |
Timeout: 30 * time.Second,
|
47 | |
}))(sumEndpoint)
|
|
47 |
}))(concatEndpoint)
|
48 | 48 |
}
|
49 | 49 |
|
50 | 50 |
return addsvc.Endpoints{
|
23 | 23 |
serverSpan.SetOperationName(operationName)
|
24 | 24 |
}
|
25 | 25 |
defer serverSpan.Finish()
|
26 | |
otext.SpanKind.Set(serverSpan, otext.SpanKindRPCServer)
|
|
26 |
otext.SpanKindRPCServer.Set(serverSpan)
|
27 | 27 |
ctx = opentracing.ContextWithSpan(ctx, serverSpan)
|
28 | 28 |
return next(ctx, request)
|
29 | 29 |
}
|
|
45 | 45 |
clientSpan = tracer.StartSpan(operationName)
|
46 | 46 |
}
|
47 | 47 |
defer clientSpan.Finish()
|
48 | |
otext.SpanKind.Set(clientSpan, otext.SpanKindRPCClient)
|
|
48 |
otext.SpanKindRPCClient.Set(clientSpan)
|
49 | 49 |
ctx = opentracing.ContextWithSpan(ctx, clientSpan)
|
50 | 50 |
return next(ctx, request)
|
51 | 51 |
}
|