Does apm-agent-go support opentracing inject and extract?

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text :slight_smile:

Kibana version:
7.6

Elasticsearch version:
7.6

APM Server version:
7.6

APM Agent language and version:
apm-go-agent 1.8 apmhttprouter 1.8

Browser version:

Original install method (e.g. download page, yum, deb, from source, etc.) and version:
debain repository

Fresh install or upgraded from other version?
no

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.
no

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
I have two microservices with opentracing implmented already. I am trying to update them to support apm-server and elastic stack. Documentation says apm-agent-go supports opentracing api. After switching to apm-server, opentracing Inject and Extract (tracing out going http request) doesn't seem to work, they are recorded as separately traces. If I change to use apmhttp.WrapClient in client service, it works. Could it be possible use opentracing api implementation only?

Hi @oscar_wu, welcome to the forum!

Yes, the Go agent does support inject/extract with OpenTracing, but only HTTP/text; the binary carrier is not supported. Do your microservices communicate using HTTP?

You can find the implementation details of these methods here: https://github.com/elastic/apm-agent-go/blob/95e54b2e24ea813e0d059e56dfe6c740681564cb/module/apmot/tracer.go#L99-L184

If you can provide a small program to demonstrate the problem you're having, we might be able to provide more help.

@axw, Thanks for you answer. Those microservices communicate using restful http. I will give a try again.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.