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

**URL:** <https://discuss.elastic.co/t/does-apm-agent-go-support-opentracing-inject-and-extract/234042>\
**Category:** APM\
**Tags:** go\
**Created:** [May 24, 2020, 1:06pm UTC](https://discuss.elastic.co/t/does-apm-agent-go-support-opentracing-inject-and-extract/234042 "2020-05-24T13:06:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oscar\_wu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_wu/32/68962_2.png) [@oscar\_wu](https://discuss.elastic.co/u/oscar_wu)\
**Post date:** [May 24, 2020, 1:06pm UTC](https://discuss.elastic.co/t/does-apm-agent-go-support-opentracing-inject-and-extract/234042/1 "2020-05-24T13:06:10Z")

</div>

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 🙂

**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?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [May 25, 2020, 1:08am UTC](https://discuss.elastic.co/t/does-apm-agent-go-support-opentracing-inject-and-extract/234042/2 "2020-05-25T01:08:10Z")

</div>

Hi @oscar_wu, welcome to the forum!

> [@](#):
>
> 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?

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](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.

---

<div class="post-metadata">

**Author:** ![oscar\_wu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_wu/32/68962_2.png) [@oscar\_wu](https://discuss.elastic.co/u/oscar_wu)\
**Post date:** [May 28, 2020, 1:27am UTC](https://discuss.elastic.co/t/does-apm-agent-go-support-opentracing-inject-and-extract/234042/3 "2020-05-28T01:27:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 17, 2020, 9:27pm UTC](https://discuss.elastic.co/t/does-apm-agent-go-support-opentracing-inject-and-extract/234042/4 "2020-06-17T21:27:41Z")

</div>

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