My API-gateway starts a tracer and a span for validate email. Then its passed to user-service
for validation.
I want to pass this span
details to user-service
as a json object and start another span
as a
tracer.start_span('Validate Email', child_of=API_gateway_span)
To do it, I have used following struct:
type checkEmail struct {
GatewayTracerSpan opentracing.SpanContext `json: gatewayTracerSpan`
Email string `json: email`
Uuid string `json: uuid`
}
In function()
validateEmailSpan := apitracer.tracer.StartSpan("Validate Email")
emailJson := checkEmail{
GatewayTracerSpan: validateEmailSpan.Context(),
Email: email,
Uuid: uuid,
}
But always GatewayTracerSpan
is empty value.
I have just started distributed-tracing. Here I selected to use json over native http-headers
as its easy for upgrade any protocol change.
Is this possible? If so, am I doing it right? Or what mistakes did I make?