Context propagation between microservices #614
Unanswered
isma3ilovich
asked this question in
Q&A
Replies: 2 comments
-
@isma3ilovich - Would you mind raising ticket for this, will take a look into it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@lalitb thank you for your reply .
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I need to propagate context between two microservices
I use the function bellow to inject my context in the first microservice
`std::string PwcOtelCommonTracer::inject( nostd::shared_ptrtrace::Span &rootSpan)
{
std::map<std::string, std::string> headers;
opentelemetry::trace::Scope scope(rootSpan);
propagatorFormat.Inject(Setter, headers,opentelemetry::context::RuntimeContext::GetCurrent());
return headers["traceparent"];
}`
The function bellow to extract the context in the second microservice:
`void PwcOtelCommonTracer::extract( std::string headers)
{
std::map<std::string, std::string> carrier;
carrier[std::string("traceparent")] = std::string(headers);
}`
but when i create new span it isn't attached with the propagated context
auto rootSpan=getTracer()->GetCurrentSpan(); trace::Scope scope(rootSpan); getTracer()->StartSpan(name);
Could you help me please ?
Thanks .
Beta Was this translation helpful? Give feedback.
All reactions