mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Wiring new context with initial span
This commit is contained in:
@@ -223,7 +223,8 @@ func (a *agent) Submit(callI Call) error {
|
|||||||
a.stats.Complete()
|
a.stats.Complete()
|
||||||
|
|
||||||
// TODO if the context is timed out here we need to allocate new one
|
// TODO if the context is timed out here we need to allocate new one
|
||||||
call.End(context.Background(), err)
|
ctx = opentracing.ContextWithSpan(context.Background(), span)
|
||||||
|
call.End(ctx, err)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,10 +103,10 @@ func FromRequest(appName, path string, req *http.Request) CallOpt {
|
|||||||
envVars[toEnvName("PARAM", param.Key)] = param.Value
|
envVars[toEnvName("PARAM", param.Key)] = param.Value
|
||||||
}
|
}
|
||||||
|
|
||||||
headerVars := make(map[string]string,len(req.Header))
|
headerVars := make(map[string]string, len(req.Header))
|
||||||
|
|
||||||
for k, v := range req.Header {
|
for k, v := range req.Header {
|
||||||
headerVars[toEnvName("HEADER",k)] = strings.Join(v, ", ")
|
headerVars[toEnvName("HEADER", k)] = strings.Join(v, ", ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// add all the env vars we build to the request headers
|
// add all the env vars we build to the request headers
|
||||||
@@ -115,7 +115,7 @@ func FromRequest(appName, path string, req *http.Request) CallOpt {
|
|||||||
req.Header.Add(k, v)
|
req.Header.Add(k, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
for k,v := range headerVars {
|
for k, v := range headerVars {
|
||||||
envVars[k] = v
|
envVars[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user