This message was deleted.
# support
s
This message was deleted.
s
cc @Srikanth Chekuri as I see your reply to a similar question https://github.com/SigNoz/signoz/issues/3390 (edited)
s
You need to inject the context into the message and extract to set span context when you consume the message.
s
Thanks @Srikanth Chekuri, Any
GO
examples you can share?
s
s
I am surprised this kind of use-case is not easily supported or documented. This is a real use-case for which I was hoping to use Signoz.
I am still blocked and can't find good examples of what you suggested
Should I file a Feature Request for this or I am missing some existing functionality.
s
There is no missing feature. OTEL does it for you most of the time, but you are using queues, so you need to do manual context propagation with OpenTelemetry and there is no documented example of it. Inject the context into carrier
Copy code
import (
	"context"
	"<http://go.opentelemetry.io/otel|go.opentelemetry.io/otel>"
)

carrier := make(map[string][]string)

// Should be replaced with the actual context
ctx := context.Background()

propagator := otel.GetTextMapPropagator()
propagator.Inject(ctx, carrier)
Extract
Copy code
import (
	"context"
	"<http://go.opentelemetry.io/otel|go.opentelemetry.io/otel>"
	"<http://go.opentelemetry.io/otel/propagation|go.opentelemetry.io/otel/propagation>"
)

carrier := make(map[string][]string)

propagator := otel.GetTextMapPropagator()
extractedContext := propagator.Extract(ctx, carrier)