Use opentracing_grpc_propagate_context when necessary
This commit is contained in:
parent
fdeeac3606
commit
b80b19902a
4 changed files with 35 additions and 2 deletions
|
|
@ -159,6 +159,7 @@ var (
|
|||
"stripLocationModifer": stripLocationModifer,
|
||||
"buildCustomErrorDeps": buildCustomErrorDeps,
|
||||
"collectCustomErrorsPerServer": collectCustomErrorsPerServer,
|
||||
"opentracingPropagateContext": opentracingPropagateContext,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -954,3 +955,17 @@ func collectCustomErrorsPerServer(input interface{}) []int {
|
|||
|
||||
return uniqueCodes
|
||||
}
|
||||
|
||||
func opentracingPropagateContext(loc interface{}) string {
|
||||
location, ok := loc.(*ingress.Location)
|
||||
if !ok {
|
||||
glog.Errorf("expected a '*ingress.Location' type but %T was returned", loc)
|
||||
return "opentracing_propagate_context"
|
||||
}
|
||||
|
||||
if location.BackendProtocol == "GRPC" || location.BackendProtocol == "GRPCS" {
|
||||
return "opentracing_grpc_propagate_context"
|
||||
}
|
||||
|
||||
return "opentracing_propagate_context"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue