In my project, I try to implement distributed tracing using opentracing
.
My microservice has following structure.
-- API-Gateway
|_ User-Service
|_ Notification
In my API-gateway, I start and in API gateway, I use a to a function to start tracing, code is taken from Setting up your tracer
in main()
:
gatewayTracer := &apiTracer{tracer: startTracing("API Gateway")}
http.HandleFunc("/getemail", gatewayTracer.validatemail)
func (apitracer apiTracer) validatemail(res http.ResponseWriter, req *http.Request) {
validateEmailSpan := apitracer.tracer.StartSpan("Validate Email")
}
I call to my User-service from validateemail()
using http.PostForm()
.
_, err := http.PostForm("http://user:7071/checkemail", url.Values{"uuid": {uuid}, "email": {email}})
Here uuid
is for separate task, not for tracing.
I can not post this Span
to the next service using PostForm()
.
How to overcome this issue?