cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Golang http client support

r_weber
DynaMight Champion
DynaMight Champion

From the technology support page and a blog article I do understand that it should be possible to track http client requests done in golang via net/http.

I have a custom application that is receiving http requests, mapping/multiplexing them and then doing multiple parallel http client requests against a webservice using the following code (simplified):

// many of these requests are created first
newreq,_ := http.NewRequest(req.Method, url, bytes.NewBuffer(payload))
newreq.Header.Add("Authorization", "Api-Token " + token)
newreq.Header.Add("Content-Type", "application/json")
...
//later the requests are executed
resp, err := client.Do(&r)

I'd have expected to see the http client calls on the PurePaths or on the stack but they seem to be not tracked.

The calls are actually made to a Dynatrace Cluster API that is also connected to the same Dynatrace Tenant so I'd have hoped for a service flow from the go "proxy" to the tenant APIs but instead I only see the go service and the incoming call on the Dynatrace API side.


The actual http client requests are done in getRespChan in a go routine.


Any ideas if/how this should work to trigger a Purepath service call?

GoLang Version 1.12.4
OneAgent 1.169
Docker Container no MUSLC


Thanks!


Certified Dynatrace Master, Dynatrace Partner - 360Performance.net
1 REPLY 1

skrystosik
DynaMight Guru
DynaMight Guru

In general monitoring Dynatrace tenant using the same DT instance (self monitoring) is not recommended. Maybe you should try creating custom services based on this. But from my experience some parts of Dynatrace are not instrumenting with OneAgent. I suppose that Dynatrace Developer can prevent such operatIons.

Sebastian


Regards, Sebastian

Featured Posts